예제 #1
0
        public void AddActor(Model.Actor actor, string displayName)
        {
            ActorInitiativeViewModel actorViewModel = ActorInitiativeViewModelFactory.GetActorViewModel(actor, this);

            actorViewModel.DisplayName = displayName;
            InitiativeCardViewModel initCardViewModel = InitiativeCardViewModelFactory.GetInitiativeCardViewModel(actorViewModel);

            AddInitiativeCard(initCardViewModel);
        }
예제 #2
0
 private void InitiativeTrackView_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (_initiativeTrack.Count > 0)
     {
         InitiativeTrackView.MoveCurrentToFirst();
         if (InitiativeTrackView.CurrentItem is InitiativeCardViewModel)
         {
             InitiativeCardViewModel initiativeCardViewModel = InitiativeTrackView.CurrentItem as InitiativeCardViewModel;
             OnInitiativeTrackChange?.Invoke(initiativeCardViewModel.ActorViewModel.ActorName);
         }
     }
 }
예제 #3
0
        public void AddInitiativeCard(InitiativeCardViewModel initCardViewModel)
        {
            if (initCardViewModel is PlayerActorInitiativeCardViewModel)
            {
                PlayerActorInitiativeCardViewModel playerCardVM = initCardViewModel as PlayerActorInitiativeCardViewModel;
                playerCardVM.OnWeaponsChange += AddWeaponSet;
                InitiativeTrack.Add(playerCardVM);

                Model.WeaponSet weaponSet = new Model.WeaponSet(playerCardVM.ActorViewModel.Actor);
                AddWeaponSet(weaponSet);
            }
            else
            {
                initCardViewModel.StartEncounter();
                InitiativeTrack.Add(initCardViewModel);
            }
        }
예제 #4
0
 public void Delete(InitiativeCardViewModel initCardViewModel)
 {
     InitiativeTrack.Remove(initCardViewModel);
 }