diff --git a/GamecraftModdingAPI/Persistence/IEntitySerializer.cs b/GamecraftModdingAPI/Persistence/IEntitySerializer.cs
index c32ee17..a060f3c 100644
--- a/GamecraftModdingAPI/Persistence/IEntitySerializer.cs
+++ b/GamecraftModdingAPI/Persistence/IEntitySerializer.cs
@@ -7,12 +7,32 @@ using GamecraftModdingAPI.Utility;
namespace GamecraftModdingAPI.Persistence
{
+ ///
+ /// Entity serializer and deserializer interface for storing and retrieving data in a Gamecraft save file (GameSave.GC).
+ ///
public interface IEntitySerializer : IDeserializationFactory, IQueryingEntitiesEngine
{
+ ///
+ /// The entity factory used for creating entities and entity components.
+ ///
+ /// The entity factory.
IEntityFactory EntityFactory { set; }
+ ///
+ /// Serialize the entities.
+ ///
+ /// Whether serialization was successful.
+ /// Serialized data to write to (writes to GameSave.GC).
+ /// Entities db for the game.
+ /// Entity serializer with support for single-entity serialization.
bool Serialize(ref ISerializationData serializationData, EntitiesDB entitiesDB, IEntitySerialization entitySerializer);
+ ///
+ /// Deserialize the entities.
+ ///
+ /// Whether deserialization was successful.
+ /// Serialized data to read from (read from GameSave.GC).
+ /// Entity serializer with support for single-entity deserialization.
bool Deserialize(ref ISerializationData serializationData, IEntitySerialization entitySerializer);
}
}
diff --git a/GamecraftModdingAPI/Persistence/SerializerManager.cs b/GamecraftModdingAPI/Persistence/SerializerManager.cs
index ae4d9c3..0584834 100644
--- a/GamecraftModdingAPI/Persistence/SerializerManager.cs
+++ b/GamecraftModdingAPI/Persistence/SerializerManager.cs
@@ -9,6 +9,11 @@ using GamecraftModdingAPI.Utility;
namespace GamecraftModdingAPI.Persistence
{
+ ///
+ /// Keeps track of serializers.
+ /// This is used to add and retrieve serializers.
+ /// Added IEntitySerializations are used in serializing and deserializing Gamecraft save files (GameSave.GC).
+ ///
public static class SerializerManager
{
private static Dictionary _serializers = new Dictionary();
diff --git a/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs b/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs
index e18943f..1048edb 100644
--- a/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs
+++ b/GamecraftModdingAPI/Persistence/SimpleEntitySerializer.cs
@@ -7,8 +7,14 @@ using RobocraftX.Common;
namespace GamecraftModdingAPI.Persistence
{
+ ///
+ /// Simple entity serializer sufficient for simple entity components.
+ ///
public class SimpleEntitySerializer : IEntitySerializer where Descriptor : ISerializableEntityDescriptor, new()
{
+ ///
+ /// Delegate function called when the serializer needs to know what entities to serialize.
+ ///
public delegate EGID[] GetEntitiesToSerialize(EntitiesDB entitiesDB);
private GetEntitiesToSerialize getEntitiesToSerialize;
@@ -54,6 +60,10 @@ namespace GamecraftModdingAPI.Persistence
return true;
}
+ ///
+ /// Construct the entity serializer.
+ ///
+ /// Provider of entity IDs to serialize.
public SimpleEntitySerializer(GetEntitiesToSerialize getEntitiesToSerialize)
{
this.getEntitiesToSerialize = getEntitiesToSerialize;
diff --git a/GamecraftModdingAPI/Utility/VersionTracking.cs b/GamecraftModdingAPI/Utility/VersionTracking.cs
index 108220c..3b83cc2 100644
--- a/GamecraftModdingAPI/Utility/VersionTracking.cs
+++ b/GamecraftModdingAPI/Utility/VersionTracking.cs
@@ -10,24 +10,38 @@ using GamecraftModdingAPI.Events;
namespace GamecraftModdingAPI.Utility
{
+ ///
+ /// Tracks the API version the current game was built for.
+ /// For compatibility reasons, this must be enabled before it will work.
+ ///
public static class VersionTracking
{
private static readonly VersionTrackingEngine versionEngine = new VersionTrackingEngine();
private static bool isEnabled = false;
+ ///
+ /// Gets the API version saved in the current game.
+ ///
+ /// The version.
public static uint GetVersion()
{
if (!isEnabled) return 0u;
return versionEngine.GetGameVersion();
}
+ ///
+ /// Enable API version tracking.
+ ///
public static void Enable()
{
EventManager.AddEventEmitter(versionEngine);
isEnabled = true;
}
+ ///
+ /// Disable API version tracking.
+ ///
public static void Disable()
{
EventManager.AddEventEmitter(versionEngine);