Пример #1
0
        /// <summary>
        /// Syncs a new player that has just joined the server
        /// </summary>
        /// <param name="username"></param>
        /// <param name="identifier"></param>
        public void SyncNewPlayer(string username, short identifier)
        {
            ClientPlayer player = new ClientPlayer(username, identifier, assets);

            Players.Add(player);
        }
Пример #2
0
        /// <summary>
        /// Moves a player in a certain direction
        /// </summary>
        /// <param name="identifier"></param>
        /// <param name="direction"></param>
        public void MovePlayer(short identifier, byte direction)
        {
            ClientPlayer player = Players.Find(ply => ply.Identifier == identifier);

            player.Move(direction);
        }
Пример #3
0
 public void AddPlayer(ClientPlayer player)
 {
     players.Add(player);
 }