> For the complete documentation index, see [llms.txt](https://moratelli.gitbook.io/moratellis-toolbelt-for-tcg-roguelike/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://moratelli.gitbook.io/moratellis-toolbelt-for-tcg-roguelike/tools/map-graph/installation.md).

# Installation

**To enable MapGraph you need to do the following changes:**

1. Change **Map.cs**

```csharp
using GraphProcessor; // Add the namespace
//...
public class Map {
  // ...
  public virtual void GenerateMap(World world) // Replace the GenerateMap with this method
  {
    MapData mdata = MapData.Get(map_id);
    System.Random seed_rand = new System.Random(seed);
    System.Random gen_rand = new System.Random(seed + map_id.GetHashCode());

    mdata.map.SetParameterValue("Map", this);
    mdata.map.SetParameterValue("Seed", seed_rand);
    mdata.map.SetParameterValue("GenSeed", gen_rand);

    new ProcessGraphProcessor(mdata.map).Run();
  }
  
  public int Depth()
  {
      return locations.Any() ? locations.Keys.OrderBy(k => k).Last() / 100 : 0;
  }

  //...
}
```

2. Change MapViewer.cs

```csharp
max_scroll = map.Depth() * row_spacing - cam_width + row_offset;
```

3. Change WorldLogic.cs

```csharp
if (location != null && location.depth == world_data.GetMap(map).Depth())
```

4. (Optional) Now that you migrated to the new Map system, you can remove some properties on MapData, like:
   1. events
   2. fixed\_widths
   3. ixed\_events
   4. fork\_probability
   5. width\_min
   6. width\_max
   7. GetLocationEvent()
   8. GetFixedLocation()
   9. GetFixedWidth()
