Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        void PostInit()
        {
            try
            {
                Rules = Ruleset.Load(modData, this, Tileset, RuleDefinitions, WeaponDefinitions,
                                     VoicDefinitions, NotificationDefinitions, MusicDefinitions, SequenceDefinitions,
                                     ModelSequenceDefinitions);
            }
            catch (Exception e)
            {
                Rules = Ruleset.LoadDefaultsForTileSet(modData, Tileset);
            }

            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();
        }
Beispiel #2
0
 public CellRegionEnumerator(CellRegion region)
 {
     cr = region;
     Reset();
 }