示例#1
0
文件: Button.cs 项目: craus/UnityTest
 public State Unpush(State state)
 {
     if (state.calledLifts.Count == 0 || state.calledLifts.Last() != this.target) {
         return null;
     }
     var result = state.Clone();
     result.calledLifts.RemoveAt(result.calledLifts.Count - 1);
     result.SetNext(state, new Push(this));
     return result;
 }
示例#2
0
文件: Button.cs 项目: craus/UnityTest
 public State Push(State state)
 {
     if (state.calledLifts.Contains(target)) {
         return null;
     }
     var result = state.Clone();
     result.calledLifts.Add(target);
     result.SetPrevious(state, new Push(this));
     return result;
 }
示例#3
0
文件: Edge.cs 项目: craus/UnityTest
 public State Unmove(State state)
 {
     if (this.lift != null && (state.calledLifts.Contains(this.lift))) {
         return null;
     }
     var result = state.Clone();
     result.position = from;
     if (this.lift != null) {
         result.calledLifts.Insert(0, this.lift);
     }
     result.SetNext(state, new Move(this));
     return result;
 }
示例#4
0
文件: Edge.cs 项目: craus/UnityTest
 public State Move(State state)
 {
     if (this.lift != null && (state.calledLifts.Count == 0 || state.calledLifts[0] != this.lift)) {
         return null;
     }
     var result = state.Clone();
     result.position = to;
     if (this.lift != null) {
         result.calledLifts.RemoveAt(0);
     }
     result.SetPrevious(state, new Move(this));
     return result;
 }
示例#5
0
文件: Edge.cs 项目: frms/UnityTest
        public State Unmove(State state)
        {
            if (this.lift != null && (state.calledLifts.Contains(this.lift)))
            {
                return(null);
            }
            var result = state.Clone();

            result.position = from;
            if (this.lift != null)
            {
                result.calledLifts.Insert(0, this.lift);
            }
            result.SetNext(state, new Move(this));
            return(result);
        }
示例#6
0
文件: Edge.cs 项目: frms/UnityTest
        public State Move(State state)
        {
            if (this.lift != null && (state.calledLifts.Count == 0 || state.calledLifts[0] != this.lift))
            {
                return(null);
            }
            var result = state.Clone();

            result.position = to;
            if (this.lift != null)
            {
                result.calledLifts.RemoveAt(0);
            }
            result.SetPrevious(state, new Move(this));
            return(result);
        }