/// <summary> /// Commands a city /// </summary> /// <param name="cmd"></param> public void CommandCity(CityCommand cmd) { ConsoleManager.Instance.WriteLine($"Commanded {Cities.Find(c => c.InstanceID == cmd.CityID).Name} - {cmd.CommandID}"); Packet p = new Packet((int)PacketHeader.CityCommand, cmd); client.SendData(p); }
// parses a packet with the header CityRemoved private void ParseCityRemoved(Packet p) { int cityID = (int)p.Item; City city = Cities.Find(c => c.InstanceID == cityID); Cities.Remove(city); UpdateCache(); ConsoleManager.Instance.WriteLine($"Removed a city {city.InstanceID}:{city.EmpireID}:{city.Name}"); OnCityRemoved(new CityEventArgs(city)); }