Beispiel #1
0
        public Gravity(string name, ActionBind o)
        {
			this.name = name;
			this.obj0 = o;
			this.bind = o;
			this.enabled = true;
		}
Beispiel #2
0
 public ActionElement(ActionBind k, bool v)
 {
     this.actions = new List <ActionEvent>(
         CollectionUtils.INITIAL_CAPACITY);
     this.key    = k;
     this.paused = v;
 }
Beispiel #3
0
 public Gravity(string name, ActionBind o)
 {
     this.name    = name;
     this.obj0    = o;
     this.bind    = o;
     this.enabled = true;
 }
Beispiel #4
0
                // 截取事件进行中数据
                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;
                    }
                }
Beispiel #5
0
        public void Paused(bool pause, ActionBind actObject)
        {
            ActionElement element = (ActionElement)actions.Get(actObject);

            if (element != null)
            {
                element.paused = pause;
            }
        }
Beispiel #6
0
        public void Start(ActionBind actObject)
        {
            ActionElement element = (ActionElement)actions.Get(actObject);

            if (element != null)
            {
                element.paused = false;
            }
        }
Beispiel #7
0
		public void RemoveAllActions(ActionBind actObject) {
			if (actObject == null) {
				return;
			}
			ActionElement element = (ActionElement) actions.Get(actObject);
			if (element != null) {
				element.actions.Clear();
				DeleteElement(element);
			}
		}
Beispiel #8
0
 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);
 }
Beispiel #9
0
		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);
			}
		}
Beispiel #10
0
        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);
        }
Beispiel #11
0
        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);
        }
Beispiel #12
0
		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);
						}
					}
				}
			}
		}
Beispiel #13
0
        public void RemoveAllActions(ActionBind actObject)
        {
            if (actObject == null)
            {
                return;
            }
            ActionElement element = (ActionElement)actions.Get(actObject);

            if (element != null)
            {
                element.actions.Clear();
                DeleteElement(element);
            }
        }
Beispiel #14
0
 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);
     }
 }
Beispiel #15
0
        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);
                        }
                    }
                }
            }
        }
Beispiel #16
0
        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);
        }
Beispiel #17
0
			public ActionElement(ActionBind k, bool v) {
                this.actions = new List<ActionEvent>(
						CollectionUtils.INITIAL_CAPACITY);
				this.key = k;
				this.paused = v;
			}
Beispiel #18
0
		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;
		}
Beispiel #19
0
		public void Start(ActionBind actObject) {
			ActionElement element = (ActionElement) actions.Get(actObject);
			if (element != null) {
				element.paused = false;
			}
		}
Beispiel #20
0
				public void Process(ActionBind o) {

				}
Beispiel #21
0
        public Gravity Add(ActionBind o, float vx, float vy, float ave)
        {
			return Add(o, vx, vy, 0, 0, ave);
		}
Beispiel #22
0
 public override void Start(ActionBind target)
 {
     base.Start(target);
     startLocation.Set(target.GetX(), target.GetY());
 }
Beispiel #23
0
				public void Stop(ActionBind o) {
					game.hero.SetFilterColor(LColor.white);
					game.hero.SetRotation(0);
				}
Beispiel #24
0
 public void RemoveAllActions(ActionBind actObject)
 {
     actions.RemoveAllActions(actObject);
 }
Beispiel #25
0
 public void RemoveAction(object tag, ActionBind actObject)
 {
     actions.RemoveAction(tag, actObject);
 }
Beispiel #26
0
 public void AddAction(ActionEvent action, ActionBind obj, bool paused)
 {
     actions.AddAction(action, obj, paused);
 }
Beispiel #27
0
 public void AddAction(ActionEvent action, ActionBind obj)
 {
     AddAction(action, obj, false);
 }
Beispiel #28
0
 public void Paused(bool pause_0, ActionBind actObject)
 {
     actions.Paused(pause_0, actObject);
 }
Beispiel #29
0
 public void Start(ActionBind actObject)
 {
     actions.Start(actObject);
 }
Beispiel #30
0
 public void Stop(ActionBind actObject)
 {
     actions.Stop(actObject);
 }
Beispiel #31
0
                public void Start(ActionBind o)
                {

                }
Beispiel #32
0
 public ActionEvent GetAction(object tag, ActionBind actObject)
 {
     return(actions.GetAction(tag, actObject));
 }
Beispiel #33
0
 public virtual void RemoveAllActions(ActionBind act)
 {
     ActionControl.GetInstance().RemoveAllActions(act);
 }
Beispiel #34
0
 public Gravity Add(ActionBind o, float vx, float vy)
 {
     return(Add(o, vx, vy, 0));
 }
Beispiel #35
0
 public void Stop(ActionBind o)
 {
     ((Actor)o).RotateTo(90);
 }
Beispiel #36
0
 public Gravity Add(ActionBind o, float vx, float vy, float ave)
 {
     return(Add(o, vx, vy, 0, 0, ave));
 }
Beispiel #37
0
				public void Start(ActionBind o) {
					game.hero.SetFilterColor(LColor.red);
					game.hero.Jump();
				}
Beispiel #38
0
                // 截取事件进行中数据
                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;
                    }

                }
Beispiel #39
0
        public Gravity Add(ActionBind o, float vx, float vy)
        {
			return Add(o, vx, vy, 0);
		}
Beispiel #40
0
 public void Stop(ActionBind o)
 {
     enemy.RemoveActionEvents();
     enemy.GetLLayer().RemoveObject(enemy);
 }
Beispiel #41
0
		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;
		}
Beispiel #42
0
		public void Dispose() {
			this.enabled = false;
			this.bind = null;
		}
Beispiel #43
0
		public void Paused(bool pause, ActionBind actObject) {
			ActionElement element = (ActionElement) actions.Get(actObject);
			if (element != null) {
				element.paused = pause;
			}
		}
Beispiel #44
0
		public Gravity(ActionBind o) {
			this.obj0 = o;
			this.bind = o;
			this.enabled = true;
		}
Beispiel #45
0
 public void Start(ActionBind o)
 {
     game.hero.SetFilterColor(LColor.red);
     game.hero.Jump();
 }
Beispiel #46
0
 public virtual void AddAction(ActionEvent e, ActionBind act)
 {
     ActionControl.GetInstance().AddAction(e, act);
 }
Beispiel #47
0
 public void Stop(ActionBind o)
 {
     game.hero.SetFilterColor(LColor.white);
     game.hero.SetRotation(0);
 }
Beispiel #48
0
 // 当角色移动完毕时
 public void Stop(ActionBind o)
 {
     // 从Layer中删除此角色
     layer.RemoveObject((Actor)o);
 }
Beispiel #49
0
 public static RectBox FromActor(ActionBind bind)
 {
     return(new RectBox(bind.GetX(), bind.GetY(), bind.GetWidth(), bind.GetHeight()));
 }
Beispiel #50
0
 public void Start(ActionBind o)
 {
 }
Beispiel #51
0
		public ActionEvent GetAction(object tag, ActionBind actObject) {
			return actions.GetAction(tag, actObject);
		}
Beispiel #52
0
 // 当角色移动完毕时
 public void Stop(ActionBind o)
 {
     // 从Layer中删除此角色
     layer.RemoveObject((Actor)o);
 }
Beispiel #53
0
 public override void Start(ActionBind target)
 {
     base.Start(target);
     startLocation.Set(target.GetX(), target.GetY());
 }
Beispiel #54
0
		public void Paused(bool pause_0, ActionBind actObject) {
			actions.Paused(pause_0, actObject);
		}
Beispiel #55
0
 public virtual void RemoveAction(object tag, ActionBind act)
 {
     ActionControl.GetInstance().RemoveAction(tag, act);
 }
Beispiel #56
0
		public void Stop(ActionBind actObject) {
			actions.Stop(actObject);
		}
Beispiel #57
0
 public void Dispose()
 {
     this.enabled = false;
     this.bind    = null;
 }
Beispiel #58
0
 public void Process(ActionBind o)
 {
 }
Beispiel #59
0
 public Gravity(ActionBind o)
 {
     this.obj0    = o;
     this.bind    = o;
     this.enabled = true;
 }
Beispiel #60
0
		public void Start(ActionBind actObject) {
			actions.Start(actObject);
		}