Esempio n. 1
0
 public void PassInstruction(string _instr)
 {
     if (_actions.TryAction(_instr, _vectorposition, map, out VectorPosition _resultvectorposition) == true)
     {
         _vectorposition = _resultvectorposition;
     }
     return;
 }
 public bool TryInstruction(string _input, VectorPosition _cvp, IMap m, out VectorPosition _vp)
 {
     _vp = _cvp;
     if (_input == "R")
     {
         _vp._direction = MovementHelper.Rotate(_cvp._direction, 1);
     }
     _vp = _cvp;
     return(false);
 }
Esempio n. 3
0
 public bool TryAction(string _input, VectorPosition _cvp, IMap m, out VectorPosition _vp)
 {
     _vp = null;
     foreach (var _instruction in _instructions)
     {
         if (_instruction.TryInstruction(_input, _cvp, m, out _vp) == true)
         {
             return(true);
         }
     }
     return(false);
 }