public Gravity(string name, ActionBind o) { this.name = name; this.obj0 = o; this.bind = o; this.enabled = true; }
public ActionElement(ActionBind k, bool v) { this.actions = new List <ActionEvent>( CollectionUtils.INITIAL_CAPACITY); this.key = k; this.paused = v; }
// 截取事件进行中数据 public void Process(ActionBind o) { // 获得角色移动方向 switch (move.GetDirection()) { case Field2D.TUP: // 根据当前移动方向,变更角色旋转方向(以下同) o.SetRotation(270); break; case Field2D.TLEFT: o.SetRotation(180); break; case Field2D.TRIGHT: o.SetRotation(0); break; case Field2D.TDOWN: o.SetRotation(90); break; default: break; } }
public void Paused(bool pause, ActionBind actObject) { ActionElement element = (ActionElement)actions.Get(actObject); if (element != null) { element.paused = pause; } }
public void Start(ActionBind actObject) { ActionElement element = (ActionElement)actions.Get(actObject); if (element != null) { element.paused = false; } }
public void RemoveAllActions(ActionBind actObject) { if (actObject == null) { return; } ActionElement element = (ActionElement) actions.Get(actObject); if (element != null) { element.actions.Clear(); DeleteElement(element); } }
public void AddAction(ActionEvent action, ActionBind actObject, bool paused) { ActionElement element = (ActionElement)actions.Get(actObject); if (element == null) { element = new ActionElement(actObject, paused); actions.Put(actObject, element); } CollectionUtils.Add(element.actions, action); action.Start(actObject); }
public virtual void Start(ActionBind o) { if (o == null) { return; } this.original = o; this.timer.Refresh(); this.firstTick = true; this.isComplete = false; this.isInit = false; if (actionListener != null) { actionListener.Start(o); } }
public Gravity Add(ActionBind o, float vx, float vy, float ax, float ay, float ave) { Gravity g = new Gravity(o); g.velocityX = vx; g.velocityY = vy; g.accelerationX = ax; g.accelerationY = ay; g.angularVelocity = ave; Add(g); return(g); }
public void RemoveAction(object tag, ActionBind actObject) { ActionElement element = (ActionElement) actions.Get(actObject); if (element != null) { if (element.actions != null) { int limit = element.actions.Count; for (int i = 0; i < limit; i++) { ActionEvent a = element.actions[i]; if (a.GetTag() == tag && a.GetOriginal() == actObject) { RemoveAction(i, element); } } } } }
public void RemoveAllActions(ActionBind actObject) { if (actObject == null) { return; } ActionElement element = (ActionElement)actions.Get(actObject); if (element != null) { element.actions.Clear(); DeleteElement(element); } }
public void RemoveAction(object tag, ActionBind actObject) { ActionElement element = (ActionElement)actions.Get(actObject); if (element != null) { if (element.actions != null) { int limit = element.actions.Count; for (int i = 0; i < limit; i++) { ActionEvent a = element.actions[i]; if (a.GetTag() == tag && a.GetOriginal() == actObject) { RemoveAction(i, element); } } } } }
public ActionEvent GetAction(object tag, ActionBind actObject) { ActionElement element = (ActionElement)actions.Get(actObject); if (element != null) { if (element.actions != null) { int limit = element.actions.Count; for (int i = 0; i < limit; i++) { ActionEvent a = element.actions[i]; if (a.GetTag() == tag) { return(a); } } } } return(null); }
public ActionElement(ActionBind k, bool v) { this.actions = new List<ActionEvent>( CollectionUtils.INITIAL_CAPACITY); this.key = k; this.paused = v; }
public ActionEvent GetAction(object tag, ActionBind actObject) { ActionElement element = (ActionElement) actions.Get(actObject); if (element != null) { if (element.actions != null) { int limit = element.actions.Count; for (int i = 0; i < limit; i++) { ActionEvent a = element.actions[i]; if (a.GetTag() == tag) return a; } } } return null; }
public void Start(ActionBind actObject) { ActionElement element = (ActionElement) actions.Get(actObject); if (element != null) { element.paused = false; } }
public void Process(ActionBind o) { }
public Gravity Add(ActionBind o, float vx, float vy, float ave) { return Add(o, vx, vy, 0, 0, ave); }
public override void Start(ActionBind target) { base.Start(target); startLocation.Set(target.GetX(), target.GetY()); }
public void Stop(ActionBind o) { game.hero.SetFilterColor(LColor.white); game.hero.SetRotation(0); }
public void RemoveAllActions(ActionBind actObject) { actions.RemoveAllActions(actObject); }
public void RemoveAction(object tag, ActionBind actObject) { actions.RemoveAction(tag, actObject); }
public void AddAction(ActionEvent action, ActionBind obj, bool paused) { actions.AddAction(action, obj, paused); }
public void AddAction(ActionEvent action, ActionBind obj) { AddAction(action, obj, false); }
public void Paused(bool pause_0, ActionBind actObject) { actions.Paused(pause_0, actObject); }
public void Start(ActionBind actObject) { actions.Start(actObject); }
public void Stop(ActionBind actObject) { actions.Stop(actObject); }
public void Start(ActionBind o) { }
public ActionEvent GetAction(object tag, ActionBind actObject) { return(actions.GetAction(tag, actObject)); }
public virtual void RemoveAllActions(ActionBind act) { ActionControl.GetInstance().RemoveAllActions(act); }
public Gravity Add(ActionBind o, float vx, float vy) { return(Add(o, vx, vy, 0)); }
public void Stop(ActionBind o) { ((Actor)o).RotateTo(90); }
public Gravity Add(ActionBind o, float vx, float vy, float ave) { return(Add(o, vx, vy, 0, 0, ave)); }
public void Start(ActionBind o) { game.hero.SetFilterColor(LColor.red); game.hero.Jump(); }
public Gravity Add(ActionBind o, float vx, float vy) { return Add(o, vx, vy, 0); }
public void Stop(ActionBind o) { enemy.RemoveActionEvents(); enemy.GetLLayer().RemoveObject(enemy); }
public Gravity Add(ActionBind o, float vx, float vy, float ax, float ay, float ave) { Gravity g = new Gravity(o); g.velocityX = vx; g.velocityY = vy; g.accelerationX = ax; g.accelerationY = ay; g.angularVelocity = ave; Add(g); return g; }
public void Dispose() { this.enabled = false; this.bind = null; }
public void Paused(bool pause, ActionBind actObject) { ActionElement element = (ActionElement) actions.Get(actObject); if (element != null) { element.paused = pause; } }
public Gravity(ActionBind o) { this.obj0 = o; this.bind = o; this.enabled = true; }
public virtual void AddAction(ActionEvent e, ActionBind act) { ActionControl.GetInstance().AddAction(e, act); }
// 当角色移动完毕时 public void Stop(ActionBind o) { // 从Layer中删除此角色 layer.RemoveObject((Actor)o); }
public static RectBox FromActor(ActionBind bind) { return(new RectBox(bind.GetX(), bind.GetY(), bind.GetWidth(), bind.GetHeight())); }
public ActionEvent GetAction(object tag, ActionBind actObject) { return actions.GetAction(tag, actObject); }
public virtual void RemoveAction(object tag, ActionBind act) { ActionControl.GetInstance().RemoveAction(tag, act); }