Exemple #1
0
 public static IsaacRoom GetRoom(IsaacDungeonModel model, int roomId)
 {
     foreach (var room in model.rooms)
     {
         if (room.roomId == roomId)
         {
             return(room);
         }
     }
     return(null);
 }
        /// <summary>
        /// Builds the dungeon layout.  In this method, you should build your dungeon layout and save it in your model file
        /// No markers should be emitted here.   (EmitMarkers function will be called later by the engine to do that)
        /// </summary>
        /// <param name="config">The builder configuration</param>
        /// <param name="model">The dungeon model that the builder will populate</param>
        public override void BuildDungeon(DungeonConfig config, DungeonModel model)
        {
            base.BuildDungeon(config, model);

            random = new System.Random((int)config.Seed);

            // We know that the dungeon prefab would have the appropriate config and models attached to it
            // Cast and save it for future reference
            isaacConfig       = config as IsaacDungeonConfig;
            isaacModel        = model as IsaacDungeonModel;
            isaacModel.config = isaacConfig;

            // Generate the city layout and save it in a model.   No markers are emitted here.
            GenerateLevelLayout();
        }