public static void ExecuteCommand(RtsCommandMessage message, ServerGame game, RemotePlayer player) { int companyId = message.ReadInt(); int vehicleId = message.ReadInt(); Company co = game.GameObjectCollection.Get<Company>(companyId); CombatVehicle vic = game.GameObjectCollection.Get<CombatVehicle>(vehicleId); if (player.Owns(co) && player.Owns(co)) { co.AddVehicle(vic); } }
public static void ExecuteCommand(RtsCommandMessage message, ServerGame game, RemotePlayer player) { int baseObjID = message.ReadInt(); int coID = message.ReadInt(); Base obj = game.GameObjectCollection.Get<Base>(baseObjID); Company co = game.GameObjectCollection.Get<Company>(coID); if (player.Owns(obj) && player.Owns(co)) { co.ResupplyPoint = obj; } }
public static void ExecuteCommand(RtsCommandMessage message, ServerGame game, RemotePlayer player) { int companyId = message.ReadInt(); int positionCount = message.ReadInt(); List<Vector2> positions = new List<Vector2>(); for (int i = 0; i < positionCount; i++) { positions.Add(message.ReadVector2()); } Company co = game.GameObjectCollection.Get<Company>(companyId); if (player.Owns(co)) { co.SetPositions(game.GameObjectCollection, positions); } }
public static void ExecuteCommand(RtsCommandMessage message, ServerGame game, RemotePlayer player) { int baseObjID = message.ReadInt(); Base obj = game.GameObjectCollection.Get<Base>(baseObjID); if (player.Owns(obj)) { obj.BuildTransportVehicle(); } }
public static void ExecuteCommand(RtsCommandMessage message, ServerGame game, RemotePlayer player) { int coID = message.ReadInt(); Company obj = game.GameObjectCollection.Get<Company>(coID); if (player.Owns(obj)) { obj.Destroy(); } }