當前位置: 首頁>>代碼示例>>C#>>正文


C# ActorInitializer類代碼示例

本文整理匯總了C#中ActorInitializer的典型用法代碼示例。如果您正苦於以下問題:C# ActorInitializer類的具體用法?C# ActorInitializer怎麽用?C# ActorInitializer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ActorInitializer類屬於命名空間,在下文中一共展示了ActorInitializer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Building

 public Building(ActorInitializer init)
 {
     this.self = init.self;
     this.topLeft = init.Get<LocationInit,int2>();
     this.Info = self.Info.Traits.Get<BuildingInfo>();
     this.PlayerPower = init.self.Owner.PlayerActor.Trait<PowerManager>();
 }
開發者ID:geckosoft,項目名稱:OpenRA,代碼行數:7,代碼來源:Building.cs

示例2: AttackPopupTurreted

 public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info)
     : base(init.self)
 {
     Info = info;
     buildComplete = init.Contains<SkipMakeAnimsInit>();
     turret = turrets.FirstOrDefault();
 }
開發者ID:Generalcamo,項目名稱:OpenRA,代碼行數:7,代碼來源:AttackPopupTurreted.cs

示例3: Parachutable

        public Parachutable(ActorInitializer init, ParachutableInfo info)
        {
            this.self = init.self;
            this.info = info;

            positionable = self.TraitOrDefault<IPositionable>();
        }
開發者ID:RobotCaleb,項目名稱:OpenRA,代碼行數:7,代碼來源:Parachutable.cs

示例4: WithBridgeSpriteBody

 public WithBridgeSpriteBody(ActorInitializer init, WithBridgeSpriteBodyInfo info)
     : base(init, info, () => 0)
 {
     self = init.Self;
     bridgeInfo = info;
     bridgeLayer = init.World.WorldActor.Trait<BridgeLayer>();
 }
開發者ID:pchote,項目名稱:OpenRA,代碼行數:7,代碼來源:WithBridgeSpriteBody.cs

示例5: FreeActorWithDelivery

        public FreeActorWithDelivery(ActorInitializer init, FreeActorWithDeliveryInfo info)
        {
            self = init.Self;
            Info = info;

            DoDelivery(self.Location + info.DeliveryOffset, info.Actor, info.DeliveringActor);
        }
開發者ID:pchote,項目名稱:OpenRA,代碼行數:7,代碼來源:FreeActorWithDelivery.cs

示例6: Transforms

 public Transforms(ActorInitializer init, TransformsInfo info)
 {
     self = init.Self;
     this.info = info;
     buildingInfo = self.World.Map.Rules.Actors[info.IntoActor].TraitInfoOrDefault<BuildingInfo>();
     faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName;
 }
開發者ID:pchote,項目名稱:OpenRA,代碼行數:7,代碼來源:Transforms.cs

示例7: Husk

 public Husk(ActorInitializer init)
 {
     this.self = init.self;
     this.location = init.Get<LocationInit,int2>();
     this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit,int>() : 128;
     self.World.WorldActor.Trait<UnitInfluence>().Add(self, this);
 }
開發者ID:pdovy,項目名稱:OpenRA,代碼行數:7,代碼來源:Husk.cs

示例8: BodyOrientation

        public BodyOrientation(ActorInitializer init, BodyOrientationInfo info)
        {
            this.info = info;
            var self = init.Self;
            var faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName;

            quantizedFacings = Exts.Lazy(() =>
            {
                // Override value is set
                if (info.QuantizedFacings >= 0)
                    return info.QuantizedFacings;

                var qboi = self.Info.TraitInfoOrDefault<IQuantizeBodyOrientationInfo>();

                // If a sprite actor has neither custom QuantizedFacings nor a trait implementing IQuantizeBodyOrientationInfo, throw
                if (qboi == null)
                {
                    if (self.Info.HasTraitInfo<WithSpriteBodyInfo>())
                        throw new InvalidOperationException("Actor '" + self.Info.Name + "' has a sprite body but no facing quantization."
                            + " Either add the QuantizeFacingsFromSequence trait or set custom QuantizedFacings on BodyOrientation.");
                    else
                        throw new InvalidOperationException("Actor type '" + self.Info.Name + "' does not define a quantized body orientation.");
                }

                return qboi.QuantizedBodyFacings(self.Info, self.World.Map.Rules.Sequences, faction);
            });
        }
開發者ID:pchote,項目名稱:OpenRA,代碼行數:27,代碼來源:BodyOrientation.cs

示例9: Gate

 public Gate(ActorInitializer init, GateInfo info)
     : base(init, info)
 {
     this.info = info;
     self = init.Self;
     OpenPosition = info.TransitionDelay;
 }
開發者ID:CH4Code,項目名稱:OpenRA,代碼行數:7,代碼來源:Gate.cs

示例10: Turreted

 public Turreted(ActorInitializer init, TurretedInfo info)
 {
     this.info = info;
     turretFacing = info.InitialFacing;
     turretFacing = init.Contains<FacingInit>() ? init.Get<FacingInit,int>() : info.InitialFacing;
     facing = init.self.TraitOrDefault<IFacing>();
 }
開發者ID:patthoyts,項目名稱:OpenRA,代碼行數:7,代碼來源:Turreted.cs

示例11: Transforms

		public Transforms(ActorInitializer init, TransformsInfo info)
		{
			self = init.self;
			this.info = info;
			bi = self.World.Map.Rules.Actors[info.IntoActor].Traits.GetOrDefault<BuildingInfo>();
			race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Country.Race;
		}
開發者ID:JackKucan,項目名稱:OpenRA,代碼行數:7,代碼來源:Transforms.cs

示例12: PowerManager

        public PowerManager(ActorInitializer init, PowerManagerInfo info)
        {
            Info = info;
            Player = init.self.Owner;

            init.world.ActorAdded += ActorAdded;
            init.world.ActorRemoved += ActorRemoved;
        }
開發者ID:pdovy,項目名稱:OpenRA,代碼行數:8,代碼來源:PowerManager.cs

示例13: RenderBuildingWarFactory

 public RenderBuildingWarFactory(ActorInitializer init, RenderBuildingInfo info)
     : base(init, info)
 {
     roof = new Animation(GetImage(init.self));
     var offset = new AnimationWithOffset( roof ) { ZOffset = 24 };
     offset.DisableFunc = () => !buildComplete;
     anims.Add("roof", offset);
 }
開發者ID:nevelis,項目名稱:OpenRA,代碼行數:8,代碼來源:RenderBuildingWarFactory.cs

示例14: Building

 public Building(ActorInitializer init)
 {
     this.self = init.self;
     this.topLeft = init.Get<LocationInit,int2>();
     Info = self.Info.Traits.Get<BuildingInfo>();
     self.CenterLocation = Game.CellSize
         * ((float2)topLeft + .5f * (float2)Info.Dimensions);
 }
開發者ID:mgatland,項目名稱:OpenRA,代碼行數:8,代碼來源:Building.cs

示例15: AttackPopupTurreted

 public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info)
     : base(init.self)
 {
     Info = info;
     Turret = init.self.Trait<Turreted>();
     if (init.Contains<SkipMakeAnimsInit>())
         buildComplete = true;
 }
開發者ID:katzsmile,項目名稱:OpenRA,代碼行數:8,代碼來源:AttackPopupTurreted.cs


注:本文中的ActorInitializer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。