Inheritance: IEntity
Exemplo n.º 1
0
        public Player[] GetPlayers()
        {
            var players = new Player[_players.Count];

            _players.Values.CopyTo(players, 0);

            return players;
        }
Exemplo n.º 2
0
 public void AddPlayer(long id, Player player)
 {
     _players.Add(id, player);
 }
Exemplo n.º 3
0
        private void HandlePlayerData(PacketReceivedEventArgs args)
        {
            var id = args.Message.ReadInt64();
            var playerName = args.Message.ReadString();
            var level = args.Message.ReadInt32();
            var positionX = args.Message.ReadInt32();
            var positionY = args.Message.ReadInt32();
            var direction = args.Message.ReadByte();
            var textureNumber = args.Message.ReadInt32();

            var player = new Player(ServiceLocator.ScreenManager.ActiveScreen.TextureManager.GetTexture("character" + textureNumber), new Vector2i(positionX, positionY));
            this.AddPlayer(id, player);

            if (id == this.ClientID)
            {
                Client.InGame = true;
            }
        }