MegaGlest/source/glest_game/network/network_types.cpp

43 lines
1.3 KiB
C++
Raw Normal View History

// ==============================================================
// This file is part of Glest (www.glest.org)
//
// Copyright (C) 2001-2008 Marti<74>o Figueroa
//
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
// by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version
// ==============================================================
#include "network_types.h"
#include "leak_dumper.h"
namespace Glest{ namespace Game{
// =====================================================
// class NetworkCommand
// =====================================================
NetworkCommand::NetworkCommand(int networkCommandType, int unitId, int commandTypeId, const Vec2i &pos, int unitTypeId, int targetId){
this->networkCommandType= networkCommandType;
this->unitId= unitId;
this->commandTypeId= commandTypeId;
this->positionX= pos.x;
this->positionY= pos.y;
this->unitTypeId= unitTypeId;
this->targetId= targetId;
}
NetworkCommand::NetworkCommand(int networkCommandType, NetworkCommandSubType ncstType, int unitId, int value1, int value2) {
this->networkCommandType= networkCommandType;
this->unitId= unitId;
this->commandTypeId= ncstType;
this->positionX= -1;
this->positionY= -1;
this->unitTypeId= value1;
this->targetId= value2;
}
}}//end namespace