Ejemplo n.º 1
0
        public List <Action> jumpInDirection(Vector3 dir)
        {
            var ret = new List <Action>();
            var ja  = new JumpAction();

            var d = PosNegAngle(Vector3.up, dir, Vector3.forward);

            //var d = Vector3.Angle(Vector3.up, dir);
            //Debug.Log(d);

            // TODO: control strafe during jump

            if (d > 0)
            {
                var la = new LeftAction();
                ret.Add(la);
            }
            else
            {
                var ra = new RightAction();
                ret.Add(ra);
            }

            ret.Add(ja);
            return(ret);
        }
 public ConsoleCommandController(BaseView view)
     : base(view)
 {
     _moveCmd = new MoveAction();
     _leftCmd = new LeftAction();
     _rightCmd = new RightAction();
     _plcCmd = new PlaceAction();
     _reportCmd = new ReportAction();
 }
 public ConsoleKeyboardController(BaseView view)
     : base(view)
 {
     _moveCmd = new MoveAction();
     _leftCmd = new LeftAction();
     _rightCmd = new RightAction();
     _plcCmd = new PlaceAction();
     _reportCmd = new ReportAction();
     this.View.Grid.Robot.CurrentPosition = new Position { Direction = Direction.NORTH, X = 0, Y = 0 };
     this.View.Grid.Robot.IsPlaced = true;
 }