本文整理汇总了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>();
}
示例2: AttackPopupTurreted
public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info)
: base(init.self)
{
Info = info;
buildComplete = init.Contains<SkipMakeAnimsInit>();
turret = turrets.FirstOrDefault();
}
示例3: Parachutable
public Parachutable(ActorInitializer init, ParachutableInfo info)
{
this.self = init.self;
this.info = info;
positionable = self.TraitOrDefault<IPositionable>();
}
示例4: WithBridgeSpriteBody
public WithBridgeSpriteBody(ActorInitializer init, WithBridgeSpriteBodyInfo info)
: base(init, info, () => 0)
{
self = init.Self;
bridgeInfo = info;
bridgeLayer = init.World.WorldActor.Trait<BridgeLayer>();
}
示例5: FreeActorWithDelivery
public FreeActorWithDelivery(ActorInitializer init, FreeActorWithDeliveryInfo info)
{
self = init.Self;
Info = info;
DoDelivery(self.Location + info.DeliveryOffset, info.Actor, info.DeliveringActor);
}
示例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;
}
示例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);
}
示例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);
});
}
示例9: Gate
public Gate(ActorInitializer init, GateInfo info)
: base(init, info)
{
this.info = info;
self = init.Self;
OpenPosition = info.TransitionDelay;
}
示例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>();
}
示例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;
}
示例12: PowerManager
public PowerManager(ActorInitializer init, PowerManagerInfo info)
{
Info = info;
Player = init.self.Owner;
init.world.ActorAdded += ActorAdded;
init.world.ActorRemoved += ActorRemoved;
}
示例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);
}
示例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);
}
示例15: AttackPopupTurreted
public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info)
: base(init.self)
{
Info = info;
Turret = init.self.Trait<Turreted>();
if (init.Contains<SkipMakeAnimsInit>())
buildComplete = true;
}