Exemplo n.º 1
0
        public PlayerBuildModel(PlayerModel parent) : base(parent.Context)
        {
            Parent                 = parent;
            ChildModel             = true;
            PlayerChanged         += PlayerBuildModel_PlayerChanged;
            Undo                   = Parent.Undo;
            Redo                   = Parent.Redo;
            race                   = new RaceViewModel(this);
            classes                = new ClassesViewModel(this);
            background             = new BackgroundViewModel(this);
            playerInventory        = new PlayerInventoryViewModel(this);
            playerShops            = new PlayerShopViewModel(this);
            playerInventoryChoices = new PlayerInventoryChoicesViewModel(this);
            playerScores           = new PlayerScoresViewModel(this);
            playerPersonal         = new PlayerPersonalViewModel(this);
            playerJournal          = new PlayerJournalViewModel(this);
            playerFeatures         = new PlayerFeaturesViewModel(this);
            playerSources          = new SourcesViewModel(this);
            playerInfo             = new PlayerInfoViewModel(this);

            UpdateSpellcasting();
        }
 public PlayerBuildModel(BuilderContext context) : base(context)
 {
     PlayerChanged += PlayerBuildModel_PlayerChanged;
     Context.HistoryButtonChange += Player_HistoryButtonChange;
     Context.SourcesChangedEvent += Context_SourcesChangedEvent;
     Undo = new Command(() =>
     {
         Context.Undo();
         FirePlayerChanged();
         Save();
     }, () =>
     {
         return(Context.CanUndo());
     });
     Redo = new Command(() =>
     {
         Context.Redo();
         FirePlayerChanged();
         Save();
     }, () =>
     {
         return(Context.CanRedo());
     });
     race                   = new RaceViewModel(this);
     classes                = new ClassesViewModel(this);
     background             = new BackgroundViewModel(this);
     playerInventory        = new PlayerInventoryViewModel(this);
     playerShops            = new PlayerShopViewModel(this);
     playerInventoryChoices = new PlayerInventoryChoicesViewModel(this);
     playerScores           = new PlayerScoresViewModel(this);
     playerPersonal         = new PlayerPersonalViewModel(this);
     playerJournal          = new PlayerJournalViewModel(this);
     playerFeatures         = new PlayerFeaturesViewModel(this);
     playerSources          = new SourcesViewModel(this);
     playerInfo             = new PlayerInfoViewModel(this);
     play                   = new SwitchToPlayModel(this);
     UpdateFormModels();
     UpdateSpellcasting();
 }