Skip to content

Commit

Permalink
installer
Browse files Browse the repository at this point in the history
  • Loading branch information
dhorions committed Apr 28, 2024
1 parent 85afa54 commit b8dc624
Show file tree
Hide file tree
Showing 13 changed files with 815 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Capital and Cargo.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34701.34
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Capital and Cargo", "Capital and Cargo.csproj", "{D6553EB8-69BC-4CA2-B048-B08BDD5F9693}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Capital and Cargo", "Capital and Cargo.csproj", "{D6553EB8-69BC-4CA2-B048-B08BDD5F9693}"
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Installer", "Installer\Installer\Installer.vdproj", "{32997C4A-9132-4AE2-90FE-8A101D8BB000}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,6 +17,8 @@ Global
{D6553EB8-69BC-4CA2-B048-B08BDD5F9693}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D6553EB8-69BC-4CA2-B048-B08BDD5F9693}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D6553EB8-69BC-4CA2-B048-B08BDD5F9693}.Release|Any CPU.Build.0 = Release|Any CPU
{32997C4A-9132-4AE2-90FE-8A101D8BB000}.Debug|Any CPU.ActiveCfg = Debug
{32997C4A-9132-4AE2-90FE-8A101D8BB000}.Release|Any CPU.ActiveCfg = Release
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Binary file added Collatoral/Start Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Collatoral/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Collatoral/icon2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Collatoral/icon2_ToP_1.ico
Binary file not shown.
Binary file added Collatoral/icon2_ToP_2.ico
Binary file not shown.
Binary file added Collatoral/icon_aKd_icon (1).ico
Binary file not shown.
Binary file added Collatoral/title banner.bmp
Binary file not shown.
Binary file added Collatoral/title banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 17 additions & 1 deletion GameDataManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,34 @@ internal class GameDataManager
public FactoryManager ? factory;
public SoundMananger? SoundMananger;
public AchievementManager? achievements;
private SqliteConnection connection = new SqliteConnection("Data Source=CandC.db");
private SqliteConnection connection;
private String reputationCalculation = "";
private static Double importReputation = .50;
private static Double exportReputation = .25;
private static Double sellReputation = .15;
private static Double buyReputation = .10;
public GameDataManager()
{
initDb();
EnsureDatabaseCreated();
initData();
}

private void initDb()
{

string dbPath = Path.Combine(getDataPath(), "CandC.db");
Debug.WriteLine("Database Path:" + dbPath);
connection = new SqliteConnection($"Data Source={dbPath}");
}
private String getDataPath()
{
string appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
appDataPath = Path.Combine(appDataPath, "Capital and Cargo");
Directory.CreateDirectory(appDataPath);
return appDataPath;
}

private void initData()
{
reputationCalculation = $"(Bought * {buyReputation.ToString(CultureInfo.InvariantCulture)}) + (Sold * {sellReputation.ToString(CultureInfo.InvariantCulture)}) + (Imported * {importReputation.ToString(CultureInfo.InvariantCulture)}) + (Exported * {exportReputation.ToString(CultureInfo.InvariantCulture)})";
Expand Down
Loading

0 comments on commit b8dc624

Please sign in to comment.