public DungeonLevel GenerateLevel()
        {
            DungeonLevel level = new DungeonLevel();

            SetupLevelSeed(level);
            List <Doorway> unexpandedDoors = new List <Doorway>();

            unexpandedDoors = level.GetUnexpandedDoors();
            while (unexpandedDoors.Count > 0 && level.Components.Count < 40)
            {
                foreach (Doorway entrance in unexpandedDoors)
                {
                    if (ExpandDungeonLevel(level, entrance))
                    {
                        entrance.connected = true;
                    }
                    else
                    {
                        level.Remove(entrance);
                    }
                }
                unexpandedDoors = level.GetUnexpandedDoors();
            }
            return(level);
        }
Exemplo n.º 2
0
 /// <summary>Уничтожает объект (принудительно - даже если нельзя уничтожить)</summary>
 public void Destroy()
 {
     if (ObjectStatus == DungeonObjectStatus.AddedNotDestroyed)
     {
         ObjectStatus = DungeonObjectStatus.Destroyed;
     }
     m_collision_type = DungeonObjectCollision.NoCollision;
     if (this is DungeonItem)
     {
         if ((this as DungeonItem).Container != null)
         {
             (this as DungeonItem).Container.Remove(this as DungeonItem);
         }
     }
     if (DungeonLevel != null)
     {
         DungeonLevel.Remove(this);
     }
 }