Exemple #1
0
    public static PlayerInfo FromBytes(BitBuffer bitBuffer)
    {
        int          id           = bitBuffer.GetByte();
        int          health       = bitBuffer.GetByte();
        PositionInfo positionInfo = PositionInfo.FromBytes(bitBuffer);

        return(new PlayerInfo(id, health, positionInfo));
    }
Exemple #2
0
    public static AbilityResponse FromBytes(BitBuffer bitBuffer)
    {
        int          id            = bitBuffer.GetByte();
        AbilityType  type          = (AbilityType)bitBuffer.GetByte();
        PositionInfo startPosition = null;

        if (type == AbilityType.AUTOATTACK)
        {
            startPosition = PositionInfo.FromBytes(bitBuffer);
        }
        return(new AbilityResponse(id, type, startPosition, PositionInfo.FromBytes(bitBuffer)));
    }
Exemple #3
0
 public static MovementInput FromBytes(int id, BitBuffer bitBuffer)
 {
     return(new MovementInput(id, PositionInfo.FromBytes(bitBuffer)));
 }
Exemple #4
0
 public static AbilityInput FromBytes(int id, BitBuffer bitBuffer)
 {
     return(new AbilityInput(id, (AbilityType)bitBuffer.GetByte(), PositionInfo.FromBytes(bitBuffer)));
 }