@@ -18,7 +18,6 @@ public MainViewModel()
18
18
RandomizeCommand = new ActionCommand ( RandomizeBrain ) ;
19
19
BrainCommand = new ActionCommand ( GetArtificialIntelligenceMove ) ;
20
20
ResetCommand = new ActionCommand ( Reset ) ;
21
- MoveCommand = new ActionCommand ( Move ) ;
22
21
23
22
RandomizeBrain ( ) ;
24
23
@@ -31,7 +30,6 @@ private void RandomizeBrain()
31
30
}
32
31
33
32
public ActionCommand RandomizeCommand { get ; }
34
- public ActionCommand MoveCommand { get ; }
35
33
36
34
public IEnumerable < ActorViewModel > Actors => _actors ;
37
35
@@ -40,35 +38,6 @@ private void GetArtificialIntelligenceMove()
40
38
State = Simulator . handleBrainMove ( _brain , _state , _random ) ;
41
39
}
42
40
43
- private void Move ( object direction )
44
- {
45
- // Parameter validation / cleansing
46
- direction ??= "" ;
47
- direction = direction . ToString ( ) . ToLowerInvariant ( ) ;
48
-
49
- // Translate from the command parameter to the GameCommand in F#
50
- Commands . GameCommand command = direction switch
51
- {
52
- "nw" => Commands . GameCommand . MoveUpLeft ,
53
- "n" => Commands . GameCommand . MoveUp ,
54
- "ne" => Commands . GameCommand . MoveUpRight ,
55
- "w" => Commands . GameCommand . MoveLeft ,
56
- "e" => Commands . GameCommand . MoveRight ,
57
- "sw" => Commands . GameCommand . MoveDownLeft ,
58
- "s" => Commands . GameCommand . MoveDown ,
59
- "se" => Commands . GameCommand . MoveDownRight ,
60
- _ => Commands . GameCommand . Wait
61
- } ;
62
-
63
- HandlePlayerCommand ( command ) ;
64
- }
65
-
66
- private void HandlePlayerCommand ( Commands . GameCommand command )
67
- {
68
- // Process the action and update our new state
69
- State = Simulator . simulateTurn ( _state , command ) ;
70
- }
71
-
72
41
public ActionCommand ResetCommand { get ; }
73
42
public ActionCommand BrainCommand { get ; }
74
43
0 commit comments