예제 #1
0
        internal EnemyInstance Clone()
        {
            EnemyInstance result = new EnemyInstance();

            CopyDataTo(result);
            return(result);
        }
예제 #2
0
        internal static EnemyInstance LoadInstance(byte[] data, ref int oData)
        {
            EnemyInstance result = new EnemyInstance();

            int byte1 = data[oData];

            oData++;
            int byte2 = data[oData];

            oData++;
            int byte3 = data[oData];

            oData++;

            result.SpriteSlot = byte1 >> 4;
            result.Respawn    = (byte1 & 0x0F) == 0x07;

            result.Difficult   = ((byte2 & 0x80) == 0x80);
            result.IsLevelBoss = (byte2 & 0x40) == 0x40;
            result.EnemyType   = byte2 & 0x0F;

            result.CompositeLocation = byte3;

            return(result);
        }
예제 #3
0
 /// <summary>
 /// Copies the data from this screen object to another screen object.
 /// </summary>
 /// <param name="dest">Screen object to copy data to.</param>
 public void CopyDataTo(EnemyInstance dest)
 {
     dest.CompositeLocation = CompositeLocation;
     dest.EnemyType         = EnemyType;
     dest.IsLevelBoss       = IsLevelBoss;
     dest.Respawn           = Respawn;
     dest.Difficult         = Difficult;
     dest.SpriteSlot        = SpriteSlot;
 }