-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2964274
commit aea2080
Showing
8 changed files
with
75 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Newtonsoft.Json; | ||
using Pulsar4X.DataStructures; | ||
|
||
namespace Pulsar4X.Datablobs; | ||
|
||
public class GeoSurveyableDB : BaseDataBlob | ||
{ | ||
[JsonProperty] | ||
public uint pointsRequired { get; set; } | ||
|
||
/// <summary> | ||
/// Stores the status of the geosurveys that have been conducted by each faction | ||
/// Key: faction id | ||
/// Value: the points remaining to complete the survey | ||
/// </summary> | ||
[JsonProperty] | ||
public SafeDictionary<int, uint> GeoSurveyStatus { get; set; } = new (); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
Pulsar4X/GameEngine/Extensions/GeoSurveyStatusDBExtensions.cs
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
Pulsar4X/GameEngine/Extensions/GeoSurveyableDBExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Pulsar4X.Datablobs; | ||
using Pulsar4X.Engine; | ||
|
||
namespace Pulsar4X.Extensions; | ||
|
||
public static class GeoSurveyableDBExtensions | ||
{ | ||
public static bool IsSurveyComplete(this GeoSurveyableDB geoSurveyableDB, int factionId) | ||
{ | ||
return geoSurveyableDB.GeoSurveyStatus.ContainsKey(factionId) | ||
&& geoSurveyableDB.GeoSurveyStatus[factionId] == 0; | ||
} | ||
|
||
public static bool HasSurveyStarted(this GeoSurveyableDB geoSurveyableDB, int factionId) | ||
{ | ||
return geoSurveyableDB.GeoSurveyStatus.ContainsKey(factionId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters