Beispiel #1
0
        public ResourceLayer(Actor self)
        {
            world = self.World;

            buildingInfluence = self.Trait <BuildingInfluence>();

            Content       = new CellLayer <CellContents>(world.Map);
            RenderContent = new CellLayer <CellContents>(world.Map);

            RenderContent.CellEntryChanged += UpdateSpriteLayers;
        }
Beispiel #2
0
        public Building(ActorInitializer init, BuildingInfo info)
        {
            self    = init.Self;
            topLeft = init.Get <LocationInit, CPos>();

            Info = info;

            influence = self.World.WorldActor.Trait <BuildingInfluence>();


            occupiedCells = Info.UnpathableTiles(TopLeft).Select(c => Pair.New(c, SubCell.FullCell)).ToArray();

            targetableCells = Info.FootprintTiles(TopLeft, FootprintCellType.Occupied).Select(c => Pair.New(c, SubCell.FullCell)).ToArray();

            CenterPosition = init.World.Map.CenterOfCell(topLeft) + Info.CenterOffset(init.World);

            SkipMakeAnimation = init.Contains <SkipMakeAnimsInit>();
        }