//public IStateData State => _state;
        //public IStaticData Static => _static;
        //public ICommands Commands { get; }
        //public ILogicAPI Logic => _additionalLogics;
        //public IClientLogicContext Context => this;
        //public IChangesApplier ChangesApplier => _changeStorage;

        //private InternalAccessors _accessors;
        //private InternalModules _modules;
        //private InternalAdditionalLogics _additionalLogics;

        public InternalContext(LogicInitData data, IServerAPI api)
        {
            //    var factory = new Internal_IStateFactory();
            //    _accessors = new InternalAccessors(Data, factory);
            //    _additionalLogics = new InternalAdditionalLogics(_accessors, _changeStorage, Data, api);
            //    _modules = new InternalModules(_accessors, _additionalLogics, Data, api);
            //    Commands = new InternalCommands(_modules, _changeStorage, data);
            //}

            //public void InitData(string clientState, string staticData)
            //{
            //     _static = _serializator.Deserialize<Internal_StaticData>(staticData);
            //    _static.PostSerialize();
            //    _accessors.SetStaticData(_static);
            //    _additionalLogics.PostInit();

            //    _state = _serializator.Deserialize<Internal_StateData>(clientState);
            //    _state.InitData(_changeStorage, _accessors);
            //    _accessors.SetStateData(_state);
            //}

            //public IStaticData GetStaticData(string staticData)
            //{
            //    _static = _serializator.Deserialize<Internal_StaticData>(staticData);
            //    _static.PostSerialize();
            //    return _static;
            //}

            //public string Save()
            //{
            //    _state.PreSave();
            //    return _serializator.Serialize(_state);
            //}
        }
 public EmulateContext(LogicInitData data, IServerAPI api)/* : base(data, true)*/
 {
     //var factory = new Emulate_IStateFactory(new Internal_IStateFactory(), _changeStorage);
     //_accessors = new InternalAccessors(Data, factory);
     //_additionalLogics = new InternalAdditionalLogics(_accessors, _changeStorage, Data, api);
     //_modules = new InternalModules(_accessors, _additionalLogics, Data, api);
     //Commands = new EmulateCommands(_modules, data);
     //_state = new Emulate_StateData();
 }
 public EmulateCommands(InternalModules modules, LogicInitData data) : base(data)
 {
     _modules = modules;
 }
 public InternalCommands(InternalModules modules, ChangeStorage storage, LogicInitData data) : base(storage, data)
 {
     _modules = modules;
 }
Beispiel #5
0
 public static IEmulateLogicFacade CreateEmulate(LogicInitData data, IServerAPI api)
 {
     return(new EmulateContext(data, api));
 }
Beispiel #6
0
 public static IClientLogicFacade Create(LogicInitData data, IServerAPI api)
 {
     return(new InternalContext(data, api));
 }