コード例 #1
0
        private void CreateLibraries()
        {
            string workingDbPath = Path.GetFullPath(@"..\..\..\..\CommonContent\moderngame.db"); // TODO: separate DB per library?
            string futureDbPath  = Path.GetFullPath(@"..\..\..\..\CommonContent\futuregame.db"); // TODO: separate DB per library?

            this._modernDB = new ModernDbConnect(workingDbPath);
            this._futureDB = new FutureDbConnect(futureDbPath);

            // TODO: version upgrading code is something else

            this._globalNotifier = new DesignTimeNotifier(this);
            this._modernLib      = new ModernD20Library(this._globalNotifier, this._modernDB);
            this._futureLib      = new FutureD20Library(this._modernLib, this._futureDB);
        }
コード例 #2
0
        public ModernD20Library(ICoreNotifications coreNotifications, IModernDatabase database) : base(database)
        {
            this._database         = database;
            this.CoreNotifications = coreNotifications;
            this.GlobalState       = new GlobalState(this);

            this.FightRoller       = new DefaultRoller(new DefaultRandomizer()); // TODO: expand rollers tree -> or move to global state
            this.GlobalDefinitions = new GlobalDefinitions(this._database);
            this.GlobalDefinitions.RegisterLibrary(this.GetType().Assembly);

            this.SavingThrowsLogic = new SavingThrowsLogic(this);
            this.ActionPointsLogic = new ActionPointsLogic(this);

            this.RestorationLogic = new RestorationLogic(this);
            // DamageLogic = new DamageLogic(this);
        }