Exemple #1
0
        public Bib(Actor self, BibInfo info)
        {
            this.info = info;

            var rs           = self.Trait <RenderSprites>();
            var building     = self.Info.Traits.Get <BuildingInfo>();
            var width        = building.Dimensions.X;
            var bibOffset    = building.Dimensions.Y - 1;
            var centerOffset = FootprintUtils.CenterOffset(building);

            tiles = new List <AnimationWithOffset>();
            for (var i = 0; i < 2 * width; i++)
            {
                var index = i;
                var anim  = new Animation(rs.GetImage(self));
                anim.PlayFetchIndex(info.Sequence, () => index);
                anim.IsDecoration = true;

                // Z-order is one set to the top of the footprint
                var offset = new CVec(i % width, i / width + bibOffset).ToWVec() - centerOffset;
                tiles.Add(new AnimationWithOffset(anim, () => offset, null, -(offset.Y + centerOffset.Y + 512)));
            }
        }
Exemple #2
0
 public Bib(Actor self, BibInfo info)
 {
     this.info = info;
     rs        = self.Trait <RenderSprites>();
     bi        = self.Info.Traits.Get <BuildingInfo>();
 }