Esempio n. 1
0
        protected void LoopPresets(uint pRoom, Room2 room, Level lvl)
        {
            for (var pPreset = room.pPreset; pPreset != 0;)
            {
                var preset = game.Debugger.Read <PresetUnit>(pPreset);

                var tileLevelNo = CollisionMap.GetTileLevelNo(game, room, preset.dwTxtFileNo);
                if (tileLevelNo != 0)
                {
                    var exit = new LevelExit
                    {
                        dwTargetLevel = tileLevelNo,
                        ptPos         = new Point((int)((room.dwPosX * 5) + preset.dwPosX), (int)((room.dwPosY * 5) + preset.dwPosY)),
                        dwType        = (uint)ExitType.Tile,
                        dwId          = preset.dwTxtFileNo,
                        pRoom2        = pRoom
                    };

                    if (!levelExits.ContainsKey(lvl.dwLevelNo))
                    {
                        levelExits.Add(lvl.dwLevelNo, new List <LevelExit>());
                    }

                    if (levelExits[lvl.dwLevelNo].Find(it => it.dwTargetLevel == tileLevelNo) == null)
                    {
                        levelExits[lvl.dwLevelNo].Add(exit);
                    }
                }

                DrawPreset(room, lvl, preset);

                pPreset = preset.pPresetNext;
            }
        }