about summary refs log tree commit diff
path: root/LibMatrix.EventTypes.Abstractions/BaseMatrixEventContent.cs
diff options
context:
space:
mode:
authorEmma [it/its]@Rory& <root@rory.gay>2024-06-03 04:59:40 +0200
committerEmma [it/its]@Rory& <root@rory.gay>2024-06-03 04:59:40 +0200
commit2a37322d78c9ce1d27cbc12e24dd918407a931e3 (patch)
treed3483edae6792bab1f10516b95779367220a2a8d /LibMatrix.EventTypes.Abstractions/BaseMatrixEventContent.cs
parentAdd all projects to sln (diff)
downloadLibMatrix-dev/event-rewrite.tar.xz
Update dependencies, some tests, other things github/dev/event-rewrite dev/event-rewrite
Diffstat (limited to 'LibMatrix.EventTypes.Abstractions/BaseMatrixEventContent.cs')
-rw-r--r--LibMatrix.EventTypes.Abstractions/BaseMatrixEventContent.cs15
1 files changed, 11 insertions, 4 deletions
diff --git a/LibMatrix.EventTypes.Abstractions/BaseMatrixEventContent.cs b/LibMatrix.EventTypes.Abstractions/BaseMatrixEventContent.cs
index eba50a5..0906e30 100644
--- a/LibMatrix.EventTypes.Abstractions/BaseMatrixEventContent.cs
+++ b/LibMatrix.EventTypes.Abstractions/BaseMatrixEventContent.cs
@@ -6,15 +6,19 @@ using ArcaneLibs.Extensions;
 
 namespace LibMatrix.EventTypes;
 
+public interface IMatrixEvent {
+    
+}
+
 // <T> : MatrixEventContent where T : MatrixEventContent<T>, new() {
 /// <summary>
 ///     Extensible Event Content, aims to provide an API similar to JsonNode/JsonObject
 ///     <seealso cref="System.Text.Json.Nodes.JsonNode"/>
 ///     <seealso cref="System.Text.Json.Nodes.JsonObject"/>
 /// </summary>
-[JsonConverter(typeof(MatrixEventContentConverter<BaseMatrixEventContent>))]
+// [JsonConverter(typeof(BaseMatrixEventContent.MatrixEventContentConverter<BaseMatrixEventContent>))]
 // [JsonSerializable(typeof(MatrixEventContent))]
-public class BaseMatrixEventContent {
+public abstract class BaseMatrixEventContent {
     public JsonObject InternalJson { get; set; } = new();
 
     public BaseMatrixEventContent() { }
@@ -23,7 +27,7 @@ public class BaseMatrixEventContent {
         InternalJson = json.AsObject();
     }
 
-    public static implicit operator BaseMatrixEventContent(JsonNode json) => new(json);
+    // public static implicit operator BaseMatrixEventContent(JsonNode json) => new(json);
 
     // public static implicit operator JsonNode(MatrixEventContent content) => content.InternalJson;
 
@@ -33,7 +37,10 @@ public class BaseMatrixEventContent {
     [JsonIgnore]
     public string EventType => EventTypes.First();
 
-    public JsonNode? this[string key] => InternalJson[key];
+    public JsonNode? this[string key] {
+        get => InternalJson[key];
+        set => InternalJson[key] = value;
+    }
     
     public string ToJson() => InternalJson.ToJson();