public void IncludesEntityGroup() { var component = UseEffectAddIntelComponent.Create(0); JsonElement deserialized = JsonSerializer.Deserialize <JsonElement>(component.Save()); Assert.Equal(UseEffectAddIntelComponent.ENTITY_GROUP, deserialized.GetProperty("EntityGroup").GetString()); }
public void SerializesAndDeserializesCorrectly() { var component = UseEffectAddIntelComponent.Create(4); string saved = component.Save(); var newComponent = UseEffectAddIntelComponent.Create(saved); Assert.Equal(component.TargetDungeonLevel, newComponent.TargetDungeonLevel); }
public static Entity CreateIntelEntity(int targetDungeonLevel) { var e = CreateEntity(Guid.NewGuid().ToString(), "intel for sector " + targetDungeonLevel); e.AddComponent(DisplayComponent.Create(_texIntelPath, "Intel! Gives you zone information for the next sector. You want this.", true, ITEM_Z_INDEX)); e.AddComponent(StorableComponent.Create()); e.AddComponent(UsableComponent.Create(useOnGet: true)); e.AddComponent(UseEffectAddIntelComponent.Create(targetDungeonLevel)); return(e); }