public void AddActor(ActorBase actor) { IBaseComponentContainer container = actor as IBaseComponentContainer; var init = container.GetInitData(); //actor.CreateBody(factory.CreateRectangleBody(init.point_x, init.point_y, 10, 10)); //判断是否是激光 if (actor.GetActorType() != ActorTypeBaseDefine.ContinuousLaserActor && actor.GetActorType() != ActorTypeBaseDefine.PowerLaserActor) { actor.CreateBody(factory.CreateSpaceWonderBody(new Vector2(init.point_x, init.point_y), init.angle, actor.GetGameModelByActorType(), new UserData(actor.GetActorID(), actor.GetActorType()))); } //是持续激光 else if (actor.GetActorType() == ActorTypeBaseDefine.ContinuousLaserActor) { //获取长宽属性 var WH = ActorHelper.GetLaserShapeByShip(actor.GetActorType()); actor.CreateBody(factory.CreateSpaceWonderLaser(new Vector2(init.point_x, init.point_y), init.angle, new UserData(actor.GetActorID(), actor.GetActorType()), WH.X, WH.Y)); } //是蓄力激光 else if (actor.GetActorType() == ActorTypeBaseDefine.PowerLaserActor) { var WH = ActorHelper.GetLaserShapeByShip(actor.GetActorType(), heightpro: actor.GetActorInitPro()); //Log.Trace("AddActor: actorID" + actor.GetActorID() + " InitDate" + init.point_x + " " + init.point_y + " " + init.angle + " WeaponDemage:" + ((IWeaponBaseComponentContainer)actor).GetWeaponDamage() + " WH" + WH.X + " " + WH.Y + " InitPro:" + actor.GetActorInitPro()); actor.CreateBody(factory.CreateSpaceWonderLaser(new Vector2(init.point_x, init.point_y), init.angle, new UserData(actor.GetActorID(), actor.GetActorType()), WH.X, WH.Y)); } //Log.Trace("AddActor: actorID" + actor.GetActorID() + " InitDate" + init.point_x + " " + init.point_y + " " + init.angle); //Log.Trace("actor id" + actor.GetActorID() + " 生成一个Actor Position:" + actor.GetPosition() + " Forward:" + actor.GetForward()); _actorList.Add(actor); }
public EliteShipAAiComponent(EliteShipAAiComponent clone, IBaseComponentContainer container) : base(clone, container) { level = container.GetLevel(); delytime = clone.delytime; initnum = clone.initnum; currenttime = DateTime.Now.Ticks; }
public EliteShipAAiComponent(IBaseComponentContainer container, int delytime, int initnum) : base(container) { level = container.GetLevel(); this.delytime = delytime; this.initnum = initnum; currenttime = DateTime.Now.Ticks; }
public static void RingDetection(this IBaseComponentContainer body, IBaseComponentContainer actor) { var body1 = body.GetPhysicalinternalBase().GetBody(); var nose = body1.GetSpaceShipNosePosition(body.GetGameModelByActorType()); //var height = actor.GetPhysicalinternalBase().GetBody().SetTransform(nose, body.GetForwardAngle()); }
public static void Detection(this IBaseComponentContainer body, IBaseContainer actor) { var body1 = body.GetPhysicalinternalBase().GetBody(); var nose = body1.GetSpaceShipNosePosition(body.GetGameModelByActorType()); var result = nose; actor.SetInitData(result.X, result.Y, body.GetForwardAngle()); }
public void RemoveActor(ActorBase actor) { IBaseComponentContainer container = actor as IBaseComponentContainer; var body = container.GetPhysicalinternalBase().GetBody(); //TODO 从世界去除 _world.DestroyBody(body); _actorList.Remove(actor); }
public AIComponentBase Clone(IBaseComponentContainer container) { return(aIComponentBase.Clone(container)); }
public BlackHoleAiComponent(BlackHoleAiComponent clone, IBaseComponentContainer container) : base(clone, container) { level = container.GetLevel(); attractRadius = clone.attractRadius; attractForce = clone.attractForce; }
protected AIComponentBase(AIComponentBase clone, IBaseComponentContainer container) { this.container = container; this.isPause = clone.isPause; }
public override AIComponentBase Clone(IBaseComponentContainer container) { return(new DeadAiComponent(this, container)); }
public override AIComponentBase Clone(IBaseComponentContainer container) { return(new FollowAiComponent(this, container as IWeaponBaseComponentContainer)); }
public override AIComponentBase Clone(IBaseComponentContainer container) { return(new ShipEnemyAiComponent(this, container as IShipComponentBaseContainer)); }
public abstract AIComponentBase Clone(IBaseComponentContainer container);
public virtual void Dispose() { container = null; isPause = true; }
public DeadAiComponent(long time, IBaseComponentContainer container) : base(container) { inittime = DateTime.Now.Ticks; this.time = time; }
public DeadAiComponent(DeadAiComponent clone, IBaseComponentContainer container) : base(clone, container) { inittime = DateTime.Now.Ticks; this.time = clone.time; }
public GogogoAiComponent(IBaseComponentContainer container, float aiforce) : base(container) { this.aiforce = aiforce; }
public GogogoAiComponent(GogogoAiComponent clone, IBaseComponentContainer container) : base(clone, container) { this.aiforce = clone.aiforce; }
public BlackHoleAiComponent(IBaseComponentContainer container, float attractradius, float attractforce) : base(container) { level = container.GetLevel(); attractRadius = attractradius; attractForce = attractforce; }
AIComponentBase IAIBase.Clone(IBaseComponentContainer container) { return(_aiComponent.Clone(container)); }
protected AIComponentBase(IBaseComponentContainer container) { this.container = container; }