예제 #1
0
파일: Door.cs 프로젝트: DJuttmann/SM3E
 public bool Connect(List <Data> Rooms, List <Data> ScrollAsms, List <Data> DoorAsms)
 {
     MyTargetRoom = (Room)Rooms.Find(x => x.StartAddressLR == RoomPtr);
     if (MyTargetRoom != null)
     {
         MyTargetRoom.MyIncomingDoors.Add(this);
     }
     MyScrollAsm = (ScrollAsm)ScrollAsms.Find(x => x.StartAddressLR == DoorAsmPtr);
     if (MyScrollAsm != null)
     {
         MyScrollAsm.MyDoors.Add(this);
     }
     else
     {
         MyDoorAsm = (Asm)DoorAsms.Find(x => x.StartAddressLR == DoorAsmPtr);
         if (MyDoorAsm != null)
         {
             MyDoorAsm.MyReferringData.Add(this);
         }
     }
     return(MyTargetRoom != null);
 }
예제 #2
0
파일: Room.cs 프로젝트: DJuttmann/SM3E
 public void SetMainAsm(Asm target, out Asm deleteAsm)
 {
     SetReference(ref MyMainAsm, target, out deleteAsm);
 }
예제 #3
0
파일: Room.cs 프로젝트: DJuttmann/SM3E
 public void SetSetupAsm(Asm target, out Asm deleteAsm)
 {
     SetReference(ref MySetupAsm, target, out deleteAsm);
 }
예제 #4
0
파일: Room.cs 프로젝트: DJuttmann/SM3E
        public bool Connect(List <Data> PlmSets,
                            List <Data> ScrollSets,
                            List <Data> Backgrounds,
                            List <Data> Fxs,
                            List <Data> LevelDatas,
                            List <Data> EnemySets,
                            List <Data> EnemyGfxs,
                            List <Data> SetupAsms,
                            List <Data> MainAsms)
        {
            bool success = true;

            if (PlmSetPtr >= 0x8F8000)
            {
                MyPlmSet = (PlmSet)PlmSets.Find(x => x.StartAddressLR == PlmSetPtr);
                if (MyPlmSet != null)
                {
                    MyPlmSet.MyRoomStates.Add(this);
                }
                else
                {
                    success = false;
                }
            }
            if (ScrollSetPtr >= 0x8F8000)
            {
                MyScrollSet = (ScrollSet)ScrollSets.Find(x => x.StartAddressLR == ScrollSetPtr);
                if (MyScrollSet != null)
                {
                    MyScrollSet.MyRoomStates.Add(this);
                }
                else
                {
                    success = false;
                }
            }
            if (BackgroundPtr >= 0x8F8000)
            {
                MyBackground = (Background)Backgrounds.Find(x => x.StartAddressLR == BackgroundPtr);
                if (MyBackground != null)
                {
                    MyBackground.MyRoomStates.Add(this);
                }
                else
                {
                    success = false;
                }
            }
            if (FxPtr >= 0x838000)
            {
                MyFx = (Fx)Fxs.Find(x => x.StartAddressLR == FxPtr);
                if (MyFx != null)
                {
                    MyFx.MyRoomStates.Add(this);
                }
                else
                {
                    success = false;
                }
            }
            if (SetupAsmPtr >= 0x8F8000)
            {
                MySetupAsm = (Asm)SetupAsms.Find(x => x.StartAddressLR == SetupAsmPtr);
                if (MySetupAsm != null)
                {
                    MySetupAsm.MyReferringData.Add(this);
                }
                else
                {
                    success = false;
                }
            }
            if (MainAsmPtr >= 0x8F8000)
            {
                MyMainAsm = (Asm)MainAsms.Find(x => x.StartAddressLR == MainAsmPtr);
                if (MyMainAsm != null)
                {
                    MyMainAsm.MyReferringData.Add(this);
                }
                else
                {
                    success = false;
                }
            }
            MyLevelData = (LevelData)LevelDatas.Find(x => x.StartAddressLR == LevelDataPtr);
            if (MyLevelData != null)
            {
                MyLevelData.MyRoomStates.Add(this);
            }
            else
            {
                success = false;
            }
            MyEnemySet = (EnemySet)EnemySets.Find(x => x.StartAddressLR == EnemySetPtr);
            if (MyEnemySet != null)
            {
                MyEnemySet.MyRoomStates.Add(this);
            }
            else
            {
                success = false;
            }
            MyEnemyGfx = (EnemyGfx)EnemyGfxs.Find(x => x.StartAddressLR == EnemyGfxPtr);
            if (MyEnemyGfx != null)
            {
                MyEnemyGfx.MyRoomStates.Add(this);
            }
            else
            {
                success = false;
            }
            return(success);
        }