Commit c9f067da authored by IceYGO's avatar IceYGO

Add the public Program.Init function

parent bb40ca78
...@@ -11,9 +11,9 @@ namespace WindBot ...@@ -11,9 +11,9 @@ namespace WindBot
{ {
public const short ProVersion = 0x1338; public const short ProVersion = 0x1338;
public static Random Rand; internal static Random Rand;
public static void Main() internal static void Main()
{ {
#if !DEBUG #if !DEBUG
try try
...@@ -29,11 +29,16 @@ namespace WindBot ...@@ -29,11 +29,16 @@ namespace WindBot
#endif #endif
} }
private static void Run() public static void Init(string databasePath)
{ {
Rand = new Random(); Rand = new Random();
DecksManager.Init(); DecksManager.Init();
InitCardsManager(); InitCardsManager(databasePath);
}
private static void Run()
{
Init("cards.cdb");
// Start two clients and connect them to the same server. Which deck is gonna win? // Start two clients and connect them to the same server. Which deck is gonna win?
GameClient clientA = new GameClient("Wind", "Horus", "127.0.0.1", 7911); GameClient clientA = new GameClient("Wind", "Horus", "127.0.0.1", 7911);
...@@ -48,10 +53,10 @@ namespace WindBot ...@@ -48,10 +53,10 @@ namespace WindBot
} }
} }
private static void InitCardsManager() private static void InitCardsManager(string databasePath)
{ {
string currentPath = Path.GetFullPath("."); string currentPath = Path.GetFullPath(".");
string absolutePath = Path.Combine(currentPath, "cards.cdb"); string absolutePath = Path.Combine(currentPath, databasePath);
NamedCardsManager.Init(absolutePath); NamedCardsManager.Init(absolutePath);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment