Ejemplo n.º 1
0
        private void CreateActionGroups(CharacterEditorViewModel viewModel)
        {
            viewModel.CharacterActionGroups = new System.Collections.ObjectModel.ObservableCollection <HeroVirtualTabletop.ManagedCharacter.CharacterActionGroupViewModel>();
            var identityGroup = new CharacterActionGroupViewModelImpl <Identity>(TestObjectsFactory.MockDesktopKeyEventHandler, viewModel.EventAggregator);
            var abilityGroup  = new CharacterActionGroupViewModelImpl <AnimatedAbility.AnimatedAbility>(TestObjectsFactory.MockDesktopKeyEventHandler, viewModel.EventAggregator);
            var movementGroup = new CharacterActionGroupViewModelImpl <CharacterMovement>(TestObjectsFactory.MockDesktopKeyEventHandler, viewModel.EventAggregator);
            var customGroup   = new CharacterActionGroupViewModelImpl <CharacterAction>(TestObjectsFactory.MockDesktopKeyEventHandler, viewModel.EventAggregator);

            viewModel.CharacterActionGroups.Add(identityGroup);
            viewModel.CharacterActionGroups.Add(abilityGroup);
            viewModel.CharacterActionGroups.Add(movementGroup);
            viewModel.CharacterActionGroups.Add(customGroup);
        }
 public HeroVirtualTabletopMainViewModelImpl(IEventAggregator eventAggregator, CrowdMemberExplorerViewModel crowdMemberExplorerViewModel,
                                             RosterExplorerViewModel rosterExplorerViewModel, CharacterEditorViewModel characterEditorViewModel, IdentityEditorViewModel identityEditorViewModel,
                                             AbilityEditorViewModel abilityEditorViewModel, MovementEditorViewModel movementEditorViewModel, ActiveCharacterWidgetViewModel activeCharacterWidgetViewModel,
                                             AttackConfigurationWidgetViewModel attackConfigurationWidgetViewModel, PopupService popupService,
                                             IconInteractionUtility iconInteractionUtility, DesktopContextMenu desktopContextMenu, Camera camera)
 {
     this.eventAggregator = eventAggregator;
     this.CrowdMemberExplorerViewModel       = crowdMemberExplorerViewModel;
     this.RosterExplorerViewModel            = rosterExplorerViewModel;
     this.CharacterEditorViewModel           = characterEditorViewModel;
     this.IdentityEditorViewModel            = identityEditorViewModel;
     this.AbilityEditorViewModel             = abilityEditorViewModel;
     this.MovementEditorViewModel            = movementEditorViewModel;
     this.ActiveCharacterWidgetViewModel     = activeCharacterWidgetViewModel;
     this.AttackConfigurationWidgetViewModel = attackConfigurationWidgetViewModel;
     this.iconInteractionUtility             = iconInteractionUtility;
     this.camera             = camera;
     this.popupService       = popupService;
     this.desktopContextMenu = desktopContextMenu;
     RegisterPopups();
     gameInitializeTimer = new System.Threading.Timer(gameInitializeTimer_Callback, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
     LaunchGame();
     this.eventAggregator.Subscribe(this);
     //this.eventAggregator.GetEvent<AddToRosterEvent>().Subscribe((IEnumerable<CrowdMemberModel> models) => { this.IsRosterExplorerExpanded = true; });
     //this.eventAggregator.GetEvent<EditCharacterEvent>().Subscribe((Tuple<ICrowdMemberModel, IEnumerable<ICrowdMemberModel>> tuple) => { this.IsCharacterEditorExpanded = true; });
     //this.eventAggregator.GetEvent<EditIdentityEvent>().Subscribe((Tuple<Identity, Character> tuple) => { this.IsIdentityEditorExpanded = true; });
     //this.eventAggregator.GetEvent<EditAbilityEvent>().Subscribe((Tuple<AnimatedAbility, Character> tuple) => { this.IsAbilityEditorExpanded = true; });
     //this.eventAggregator.GetEvent<EditMovementEvent>().Subscribe((CharacterMovement cm) => { this.IsMovementEditorExpanded = true; });
     //this.eventAggregator.GetEvent<CreateCrowdFromModelsEvent>().Subscribe((CrowdModel crowd) => { this.IsCrowdFromModelsExpanded = true; });
     //this.eventAggregator.GetEvent<AttackInitiatedEvent>().Subscribe((Tuple<Character, Attack> tuple) => { this.IsRosterExplorerExpanded = true; });
 }
 public void TestInitialize()
 {
     characterEditorVM = new CharacterEditorViewModel(busyServiceMock.Object, unityContainerMock.Object, eventAggregatorMock.Object);
     character         = new CrowdMemberModel("Spyder");
     characterEditorVM.LoadCharacter(new Tuple <ICrowdMemberModel, IEnumerable <ICrowdMemberModel> >(character, null));
 }
 public void Initialize()
 {
     TestCharacter = new Mock <Character>().Object;
     CharEditorVM  = new CharacterEditorViewModel(busyServiceMock.Object, unityContainerMock.Object, eventAggregatorMock.Object);
     CharEditorVM.EditedCharacter = TestCharacter;
 }