当前位置: 首页>>代码示例>>C#>>正文


C# ActorInitializer.Contains方法代码示例

本文整理汇总了C#中ActorInitializer.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# ActorInitializer.Contains方法的具体用法?C# ActorInitializer.Contains怎么用?C# ActorInitializer.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ActorInitializer的用法示例。


在下文中一共展示了ActorInitializer.Contains方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Aircraft

        public Aircraft( ActorInitializer init , AircraftInfo info)
        {
            if (init.Contains<LocationInit>())
                this.Location = init.Get<LocationInit,int2>();

            this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit,int>() : info.InitialFacing;
            this.Altitude = init.Contains<AltitudeInit>() ? init.Get<AltitudeInit,int>() : 0;
            Info = info;
        }
开发者ID:subspace,项目名称:OpenRA,代码行数:9,代码来源:Aircraft.cs

示例2: Aircraft

        public Aircraft( ActorInitializer init , AircraftInfo info)
        {
            this.self = init.self;
            if( init.Contains<LocationInit>() )
                this.SubPxPosition = 1024 * Util.CenterOfCell( init.Get<LocationInit, int2>() );

            this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit,int>() : info.InitialFacing;
            this.Altitude = init.Contains<AltitudeInit>() ? init.Get<AltitudeInit,int>() : 0;
            Info = info;
        }
开发者ID:katzsmile,项目名称:OpenRA,代码行数:10,代码来源:Aircraft.cs

示例3: GetInitialTurretFacing

        public static int GetInitialTurretFacing(ActorInitializer init, int def)
        {
            if (init.Contains<TurretFacingInit>())
                return init.Get<TurretFacingInit,int>();

            if (init.Contains<FacingInit>())
                return init.Get<FacingInit,int>();

            return def;
        }
开发者ID:hoxworth,项目名称:OpenRA,代码行数:10,代码来源:Turreted.cs

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: Mobile

        public Mobile(ActorInitializer init, MobileInfo info)
        {
            this.self = init.self;
            this.Info = info;

            uim = self.World.WorldActor.Trait<UnitInfluence>();

            if (init.Contains<LocationInit>())
            {
                this.__fromCell = this.__toCell = init.Get<LocationInit, int2>();
                this.PxPosition = Util.CenterOfCell(fromCell);
            }

            this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit, int>() : info.InitialFacing;
            this.Altitude = init.Contains<AltitudeInit>() ? init.Get<AltitudeInit, int>() : 0;
        }
开发者ID:patthoyts,项目名称:OpenRA,代码行数:16,代码来源:Mobile.cs

示例10: 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

示例11: 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

示例12: RenderBuilding

 public RenderBuilding( ActorInitializer init, Func<int> baseFacing )
     : base(init.self, baseFacing)
 {
     var self = init.self;
     if( init.Contains<SkipMakeAnimsInit>() || !self.Info.Traits.Get<RenderBuildingInfo>().HasMakeAnimation )
         anim.PlayThen( "idle", () => self.World.AddFrameEndTask( _ => Complete( self ) ) );
     else
         anim.PlayThen( "make", () => self.World.AddFrameEndTask( _ => Complete( self ) ) );
 }
开发者ID:mgatland,项目名称:OpenRA,代码行数:9,代码来源:RenderBuilding.cs

示例13: Mobile

        public Mobile(ActorInitializer init, MobileInfo info)
        {
            this.self = init.self;
            this.Info = info;

            toSubCell = fromSubCell = info.SharesCell ? SubCell.Center : SubCell.FullCell;
            if (init.Contains<SubCellInit>())
            {
                this.fromSubCell = this.toSubCell = init.Get<SubCellInit, SubCell>();
            }

            if (init.Contains<LocationInit>())
            {
                this.__fromCell = this.__toCell = init.Get<LocationInit, int2>();
                this.PxPosition = Util.CenterOfCell(fromCell) + info.SubCellOffsets[fromSubCell];
            }

            this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit, int>() : info.InitialFacing;
            this.Altitude = init.Contains<AltitudeInit>() ? init.Get<AltitudeInit, int>() : 0;
        }
开发者ID:jeff-1amstudios,项目名称:OpenRA,代码行数:20,代码来源:Mobile.cs

示例14: ProvidesPrerequisite

        public ProvidesPrerequisite(ActorInitializer init, ProvidesPrerequisiteInfo info)
        {
            this.info = info;
            prerequisite = info.Prerequisite;

            if (string.IsNullOrEmpty(prerequisite))
                prerequisite = init.Self.Info.Name;

            var race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Country.Race;

            Update(init.Self.Owner, race);
        }
开发者ID:ushardul,项目名称:OpenRA,代码行数:12,代码来源:ProvidesPrerequisite.cs

示例15: ProvidesPrerequisite

        public ProvidesPrerequisite(ActorInitializer init, ProvidesPrerequisiteInfo info)
        {
            this.info = info;
            prerequisite = info.Prerequisite;

            if (string.IsNullOrEmpty(prerequisite))
                prerequisite = init.Self.Info.Name;

            var faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName;

            Update(init.Self.Owner, faction);
        }
开发者ID:CH4Code,项目名称:OpenRA,代码行数:12,代码来源:ProvidesPrerequisite.cs


注:本文中的ActorInitializer.Contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。