Beispiel #1
0
 public LaysTerrain(Actor self, LaysTerrainInfo info)
 {
     this.info    = info;
     layer        = self.World.WorldActor.Trait <CustomTerrainLayer>();
     template     = self.World.Map.Rules.TileSet.Templates[info.Template];
     buildingInfo = self.Info.TraitInfo <BuildingInfo>();
 }
Beispiel #2
0
        public LaysTerrain(Actor self, LaysTerrainInfo info)
        {
            this.info = info;
            layer     = self.World.WorldActor.Trait <CustomTerrainLayer>();

            var terrainInfo = self.World.Map.Rules.TerrainInfo as ITemplatedTerrainInfo;

            if (terrainInfo == null)
            {
                throw new InvalidDataException("LaysTerrain requires a template-based tileset.");
            }

            template = terrainInfo.Templates[info.Template];

            buildingInfo = self.Info.TraitInfo <BuildingInfo>();
        }