public void IncludesEntityGroup()
        {
            var         component    = UseEffectBoostPowerComponent.Create(0, 0);
            JsonElement deserialized = JsonSerializer.Deserialize <JsonElement>(component.Save());

            Assert.Equal(UseEffectBoostPowerComponent.ENTITY_GROUP, deserialized.GetProperty("EntityGroup").GetString());
        }
        public void SerializesAndDeserializesCorrectly()
        {
            var    component = UseEffectBoostPowerComponent.Create(99, 11);
            string saved     = component.Save();

            var newComponent = UseEffectBoostPowerComponent.Create(saved);

            Assert.Equal(component.BoostPower, newComponent.BoostPower);
            Assert.Equal(component.Duration, newComponent.Duration);
        }
예제 #3
0
        private static Entity CreateExtraBatteryEntity()
        {
            var e = CreateEntity(Guid.NewGuid().ToString(), "extra battery");

            e.AddComponent(DisplayComponent.Create(_texBatteryPath, "An extra battery for your weapons. Gives 20 power for 450 ticks.", true, ITEM_Z_INDEX));
            e.AddComponent(StorableComponent.Create());
            e.AddComponent(UsableComponent.Create(useOnGet: false));
            e.AddComponent(UseEffectBoostPowerComponent.Create(boostPower: 20, duration: 450));

            return(e);
        }