void PostInit()
{
try
{
Rules = Ruleset.Load(modData, this, Tileset, RuleDefinitions, WeaponDefinitions,
VoiceDefinitions, NotificationDefinitions, MusicDefinitions, SequenceDefinitions);
}
catch (Exception e)
{
InvalidCustomRules = true;
Rules = Ruleset.LoadDefaultsForTileSet(modData, Tileset);
Log.Write("debug", "Failed to load rules for {0} with error {1}", Title, e.Message);
}
Rules.Sequences.Preload();
var tl = new MPos(0, 0).ToCPos(this);
var br = new MPos(MapSize.X - 1, MapSize.Y - 1).ToCPos(this);
AllCells = new CellRegion(Grid.Type, tl, br);
var btl = new PPos(Bounds.Left, Bounds.Top);
var bbr = new PPos(Bounds.Right - 1, Bounds.Bottom - 1);
SetBounds(btl, bbr);
CustomTerrain = new CellLayer<byte>(this);
foreach (var uv in AllCells.MapCoords)
CustomTerrain[uv] = byte.MaxValue;
AllEdgeCells = UpdateEdgeCells();
}