public ActorPreviewPlaceBuildingPreviewPreview(WorldRenderer wr, ActorInfo ai, ActorPreviewPlaceBuildingPreviewInfo info, TypeDictionary init)
            : base(wr, ai, info)
        {
            this.info = info;
            var previewInit = new ActorPreviewInitializer(ActorInfo, wr, init);

            preview = ActorInfo.TraitInfos <IRenderActorPreviewInfo>()
                      .SelectMany(rpi => rpi.RenderPreview(previewInit))
                      .ToArray();
        }
Esempio n. 2
0
        public ActorPreviewPlaceBuildingPreviewPreview(WorldRenderer wr, ActorInfo ai, ActorPreviewPlaceBuildingPreviewInfo info, TypeDictionary init)
            : base(wr, ai, info, init)
        {
            this.info = info;
            var previewInit = new ActorPreviewInitializer(actorInfo, wr, init);

            preview = actorInfo.TraitInfos <IRenderActorPreviewInfo>()
                      .SelectMany(rpi => rpi.RenderPreview(previewInit))
                      .ToArray();

            if (!string.IsNullOrEmpty(info.OverridePalette))
            {
                var owner = init.Get <OwnerInit>().Value(wr.World);
                palette = wr.Palette(info.OverridePaletteIsPlayerPalette ? info.OverridePalette + owner.InternalName : info.OverridePalette);
            }
        }