Exemplo n.º 1
0
        public IPacket ReadPacket(IMinecraftDataReader reader)
        {
            TeamName = reader.ReadString();
            Action   = (TeamAction)reader.ReadByte();

            switch (Action)
            {
            case TeamAction.CreateTeam:
                Team = new TeamsCreateTeam().FromReader(reader);
                break;

            case TeamAction.RemoveTeam:
                Team = new TeamsRemoveTeam().FromReader(reader);
                break;

            case TeamAction.UpdateTeam:
                Team = new TeamsUpdateTeam().FromReader(reader);
                break;

            case TeamAction.AddPlayers:
                Team = new TeamsAddPlayers().FromReader(reader);
                break;

            case TeamAction.RemovePlayers:
                Team = new TeamsRemovePlayers().FromReader(reader);
                break;
            }

            return(this);
        }
Exemplo n.º 2
0
        public IPacket ReadPacket(IMinecraftDataReader reader)
        {
            TeamName = reader.ReadString();
            Action = (TeamAction) reader.ReadByte();

            switch (Action)
            {
                case TeamAction.CreateTeam:
                    Team = new TeamsCreateTeam().FromReader(reader);
                    break;
                case TeamAction.RemoveTeam:
                    Team = new TeamsRemoveTeam().FromReader(reader);
                    break;
                case TeamAction.UpdateTeam:
                    Team = new TeamsUpdateTeam().FromReader(reader);
                    break;
                case TeamAction.AddPlayers:
                    Team = new TeamsAddPlayers().FromReader(reader);
                    break;
                case TeamAction.RemovePlayers:
                    Team = new TeamsRemovePlayers().FromReader(reader);
                    break;
            }

            return this;
        }