File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11* /obj /*
22* /bin /*
3- .vs /*
3+ * / .vs /*
Original file line number Diff line number Diff line change 4545 <Compile Include =" Cell.cs" />
4646 <Compile Include =" CellOverseer.cs" />
4747 <Compile Include =" Enums\CellActionEnum.cs" />
48+ <Compile Include =" Enums\UserActionEnum.cs" />
49+ <Compile Include =" Input\ConsoleInputManager.cs" />
4850 <Compile Include =" Interfaces\ICell.cs" />
4951 <Compile Include =" Interfaces\IUserActionManager.cs" />
5052 <Compile Include =" Interfaces\ICellPrinter.cs" />
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
4+ using System . Text ;
5+ using System . Threading . Tasks ;
6+
7+ namespace CellSimulator . Enums
8+ {
9+ public enum UserActionEnum
10+ {
11+ INVALID ,
12+ SAVE ,
13+ LOAD ,
14+ SWITCHSHOWINFO ,
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
4+ using System . Text ;
5+ using System . Threading . Tasks ;
6+ using CellSimulator . Enums ;
7+ using CellSimulator . Interfaces ;
8+
9+ namespace CellSimulator . Input
10+ {
11+ public class ConsoleInputManager : IUserActionManager
12+ {
13+ public UserActionEnum GetUserAction ( )
14+ {
15+ Console . Write ( "Enter Action: " ) ;
16+ if ( Enum . TryParse ( Console . ReadLine ( ) . ToUpper ( ) , out UserActionEnum result ) )
17+ {
18+ return result ;
19+ }
20+ else
21+ {
22+ return UserActionEnum . INVALID ;
23+ }
24+
25+ }
26+ }
27+ }
Original file line number Diff line number Diff line change 33using System . Linq ;
44using System . Text ;
55using System . Threading . Tasks ;
6+ using CellSimulator . Enums ;
67
78namespace CellSimulator . Interfaces
89{
9- class IUserActionManager
10+ public interface IUserActionManager
1011 {
12+ UserActionEnum GetUserAction ( ) ;
1113 }
1214}
You can’t perform that action at this time.
0 commit comments