예제 #1
0
파일: Client.cs 프로젝트: tim-ings/Dominion
        /// <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);
        }
예제 #2
0
파일: Client.cs 프로젝트: tim-ings/Dominion
        // 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));
        }