-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
87 lines (74 loc) · 2.18 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using System;
using System.Collections.Generic;
using System.IO;
using System.Data.OleDb;
using System.Data;
using System.Collections;
using System.Reflection;
using MongoDB;
//IronPython Stuff
using IronPython.Hosting;
using IronPython.Runtime;
using Microsoft.Scripting.Hosting;
//Events
namespace PokemonTCG
{
internal class Program
{
//Variables
private static void Main(string[] args)
{
//Use bubble up catches
try
{
Console.WriteLine("Please Select a Game mode");
Console.WriteLine("(1) Networked");
Console.WriteLine("(2) Offline Multiplayer");
Console.WriteLine("(3) Vs Computer");
string mode;
bool validMode = false;
// keep taking user input until a valid mode is selected (ie. validMode == true)
do
{
mode = Console.ReadLine();
//Might get an Format exception here
switch ((Enums.gameType)int.Parse(mode))
{
case Enums.gameType.Networked:
Console.WriteLine("Sorry, this feature had yet to be implemented");
break;
/* Network Game Pseudo Code
* 1) Pick port and ipaddress
* 2) See if a connection can be made,
* 3) Exchange Player Objects
* 4) Start exchanging Lua Scripts
*/
case Enums.gameType.Offline:
validMode = true;
//Get the game started.
Game theGame = new Game(Enums.gameType.Offline);
theGame.Main();
break;
case Enums.gameType.Computer:
Console.WriteLine("Sorry, this feature had yet to be implemented");
break;
default:
Console.WriteLine("Sorry, you must select one of the options.");
break;
}
} while(validMode == false);
}
//TODO: Make the game continue if this is thrown
catch (NotImplementedException e)
{
Console.WriteLine("woops forgot to add code for {0}", e.ToString());
Console.ReadLine();
}
catch (FormatException e)
{
Console.WriteLine("Invalid game type. Exception: {0}", e.Message);
Console.Read();
}
}
}
}