当前位置: 首页>>代码示例>>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;未经允许,请勿转载。