// USE CASE: Loading and saving Document Definitions
        public static void Loading_and_saving_Document_Definitions(IEngine engine)
        {
            trace("Create an empty Document Definition in memory...");
            IDocumentDefinition documentDefinition = engine.CreateDocumentDefinition();

            assert(documentDefinition != null);

            trace("Load a Document Definition from file...");
            ICustomStorage customStorage = documentDefinition as ICustomStorage;

            assert(customStorage != null);
            customStorage.LoadFromFile(SamplesFolder + "\\SampleProject\\Templates\\Invoice_eng.fcdot");

            trace("Modify if required and check the modified version...");
            assert(documentDefinition.Check() == true);

            trace("Save the modified copy...");
            customStorage.SaveToFile(SamplesFolder + "\\SampleProject\\Templates\\Invoice_engCOPY.fcdot");
        }
예제 #2
0
 public CustomStoreService(ICustomStorage database)
 {
     _db = database;
 }
예제 #3
0
        /// <summary>
        /// Create new instance of the Server class
        /// </summary>
        public ServerCore(
            XmlSettingsManager <ServerSettings> settingsManager,
            WorldGenerator worldGenerator,
            IUsersStorage usersStorage,
            IChunksStorage chunksStorage,
            IEntityStorage entityStorage,
            ICustomStorage customStorage,
            EntityFactory entityFactory,
            WorldParameters wp
            )
        {
            // dependency injection
            SettingsManager = settingsManager;
            UsersStorage    = usersStorage;
            EntityStorage   = entityStorage;
            CustomStorage   = customStorage;
            EntityFactory   = entityFactory;
            WorldParameters = wp;

            if (SettingsManager.Settings == null)
            {
                SettingsManager.Load();
            }

            var settings = SettingsManager.Settings;

            ConnectionManager = new ConnectionManager(SettingsManager.Settings.ServerPort);

            Scheduler = new ScheduleManager();

            UtopiaTime startTime = CustomStorage.GetVariable <UtopiaTime>("GameTimeElapsed");

            Clock = new Clock(this, startTime, TimeSpan.FromMinutes(20));

            LandscapeManager = new ServerLandscapeManager(
                this,
                chunksStorage,
                worldGenerator,
                EntityFactory,
                settings.ChunkLiveTimeMinutes,
                settings.CleanUpInterval,
                settings.SaveInterval,
                settings.ChunksCountLimit,
                wp);

            EntityManager = new EntityManager(this);

            AreaManager = new AreaManager(this);

            DynamicIdHelper.SetMaxExistsId(EntityStorage.GetMaximumId());

            Services = new ServiceManager(this);

            PerformanceManager = new PerformanceManager(AreaManager);

            CommandsManager = new CommandsManager(this);

            ChatManager = new ChatManager(this);

            GlobalStateManager = new GlobalStateManager(this);

            LoginManager = new LoginManager(this, EntityFactory);

            EntitySpawningManager = new EntitySpawningManager(this, worldGenerator.EntitySpawningControler);

            EntityGrowingManager = new Managers.EntityGrowingManager(this);
        }
예제 #4
0
 public CustomStoreResourceLocator(ICustomStorage database)
 {
     _db = database;
 }