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)); }
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))); }
public static MovementInput FromBytes(int id, BitBuffer bitBuffer) { return(new MovementInput(id, PositionInfo.FromBytes(bitBuffer))); }
public static AbilityInput FromBytes(int id, BitBuffer bitBuffer) { return(new AbilityInput(id, (AbilityType)bitBuffer.GetByte(), PositionInfo.FromBytes(bitBuffer))); }