diff --git a/common/src/main/java/net/infumia/frame/context/Context.java b/common/src/main/java/net/infumia/frame/context/Context.java index 67553f9..cb329fd 100644 --- a/common/src/main/java/net/infumia/frame/context/Context.java +++ b/common/src/main/java/net/infumia/frame/context/Context.java @@ -5,13 +5,10 @@ import net.infumia.frame.typedkey.TypedKeyStorage; import org.jetbrains.annotations.NotNull; -public interface Context { +public interface Context extends StateFactory { @NotNull Frame manager(); @NotNull TypedKeyStorage instances(); - - @NotNull - StateFactory stateFactory(); } diff --git a/core/src/main/java/net/infumia/frame/context/ContextImpl.java b/core/src/main/java/net/infumia/frame/context/ContextImpl.java index e12cbaf..05f379e 100644 --- a/core/src/main/java/net/infumia/frame/context/ContextImpl.java +++ b/core/src/main/java/net/infumia/frame/context/ContextImpl.java @@ -1,28 +1,26 @@ package net.infumia.frame.context; import net.infumia.frame.Frame; -import net.infumia.frame.state.StateFactory; import net.infumia.frame.state.StateFactoryImpl; import net.infumia.frame.state.StateRegistry; import net.infumia.frame.typedkey.TypedKeyStorage; import org.jetbrains.annotations.NotNull; -public class ContextImpl implements ContextRich { +public class ContextImpl extends StateFactoryImpl implements ContextRich { private final Frame manager; private final TypedKeyStorage instances; private final StateRegistry stateRegistry; - private final StateFactory stateFactory; public ContextImpl( @NotNull final Frame manager, @NotNull final TypedKeyStorage instances, @NotNull final StateRegistry stateRegistry ) { + super(stateRegistry); this.manager = manager; this.instances = instances; this.stateRegistry = stateRegistry; - this.stateFactory = new StateFactoryImpl(stateRegistry); } public ContextImpl(@NotNull final Context context) { @@ -41,12 +39,6 @@ public TypedKeyStorage instances() { return this.instances; } - @NotNull - @Override - public StateFactory stateFactory() { - return this.stateFactory; - } - @NotNull @Override public StateRegistry stateRegistry() { diff --git a/core/src/main/java/net/infumia/frame/state/StateFactoryImpl.java b/core/src/main/java/net/infumia/frame/state/StateFactoryImpl.java index 8978fe6..6b61dcc 100644 --- a/core/src/main/java/net/infumia/frame/state/StateFactoryImpl.java +++ b/core/src/main/java/net/infumia/frame/state/StateFactoryImpl.java @@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public final class StateFactoryImpl implements StateFactory { +public class StateFactoryImpl implements StateFactory { private static final AtomicLong COUNTER = new AtomicLong();