Пример #1
0
            public CollisionMask(Reader reader, bool DCver = false)
            {
                if (DCver)
                {
                    //Path A stuff

                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision1Up[i]      = (byte)((c & 0xF0) >> 4);
                        Collision1UpSolid[i] = (byte)(c & 0x0F);
                    }
                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision1Right[i]      = (byte)((c & 0xF0) >> 4);
                        Collision1RightSolid[i] = (byte)(c & 0x0F);
                    }
                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision1Left[i]      = (byte)((c & 0xF0) >> 4);
                        Collision1LeftSolid[i] = (byte)(c & 0x0F);
                    }
                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision1Down[i]      = (byte)((c & 0xF0) >> 4);
                        Collision1DownSolid[i] = (byte)(c & 0x0F);
                    }

                    //Path B Junk

                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision2Up[i]      = (byte)((c & 0xF0) >> 4);
                        Collision2UpSolid[i] = (byte)(c & 0x0F);
                        //Load Collision Values (Path A)
                    }
                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision2Right[i]      = (byte)((c & 0xF0) >> 4);
                        Collision2RightSolid[i] = (byte)(c & 0x0F);
                    }
                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision2Left[i]      = (byte)((c & 0xF0) >> 4);
                        Collision2LeftSolid[i] = (byte)(c & 0x0F);
                    }
                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision2Down[i]      = (byte)((c & 0xF0) >> 4);
                        Collision2DownSolid[i] = (byte)(c & 0x0F);
                    }
                }
                else if (!DCver)
                {
                    //IDEK
                    PCunknown = reader.ReadByte(); // Single Byte

                    //Path A stuff

                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision1Up[i]      = (byte)((c & 0xF0) >> 4);
                        Collision1UpSolid[i] = (byte)(c & 0x0F);
                    }
                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision1Right[i]      = (byte)((c & 0xF0) >> 4);
                        Collision1RightSolid[i] = (byte)(c & 0x0F);
                    }
                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision1Left[i]      = (byte)((c & 0xF0) >> 4);
                        Collision1LeftSolid[i] = (byte)(c & 0x0F);
                    }
                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision1Down[i]      = (byte)((c & 0xF0) >> 4);
                        Collision1DownSolid[i] = (byte)(c & 0x0F);
                    }

                    //Path B Junk

                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision2Up[i]      = (byte)((c & 0xF0) >> 4);
                        Collision2UpSolid[i] = (byte)(c & 0x0F);
                        //Load Collision Values (Path A)
                    }
                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision2Right[i]      = (byte)((c & 0xF0) >> 4);
                        Collision2RightSolid[i] = (byte)(c & 0x0F);
                    }
                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision2Left[i]      = (byte)((c & 0xF0) >> 4);
                        Collision2LeftSolid[i] = (byte)(c & 0x0F);
                    }
                    for (int i = 0; i < 16; i++)
                    {
                        byte c = reader.ReadByte();
                        Collision2Down[i]      = (byte)((c & 0xF0) >> 4);
                        Collision2DownSolid[i] = (byte)(c & 0x0F);
                    }
                }
            }
Пример #2
0
 internal SaveData(Reader reader)
 {
     CurrentLevel = reader.ReadByte();
     EmeraldCount = reader.ReadByte();
     Lives        = reader.ReadByte();
 }