示例#1
0
 public override void Deserialize(ByteStreamReader reader)
 {
     base.Deserialize(reader);
     m_who       = reader.ReadInt();
     m_direction = reader.ReadVector2();
     m_point     = reader.ReadVector2();
 }
示例#2
0
 public override void Deserialize(ByteStreamReader reader)
 {
     m_sessionId       = reader.ReadInt();
     m_actuallySpawned = reader.ReadBool();
     if (m_actuallySpawned)
     {
         m_startPosition = reader.ReadVector2();
     }
 }
示例#3
0
    public bool Deserialize(ByteStreamReader reader)
    {
        id = reader.ReadInt();

        int changeMask = reader.ReadByte();

        bool changedPosition = (changeMask & maskOfPositionChange) != 0,
             changedHealth   = (changeMask & maskOfHealthChange) != 0;

        if (changedHealth)
        {
            power = reader.ReadFloat();
            Console.WriteLine("Applying health: " + power);
        }
        if (changedPosition)
        {
            position = reader.ReadVector2();
            Console.WriteLine("Applying position: " + position);
        }

        return(true);
    }
示例#4
0
 public override void Deserialize(ByteStreamReader reader)
 {
     m_direction = reader.ReadVector2();
     m_sessionId = reader.ReadInt();
 }