public void AddActor(Model.Actor actor, string displayName) { ActorInitiativeViewModel actorViewModel = ActorInitiativeViewModelFactory.GetActorViewModel(actor, this); actorViewModel.DisplayName = displayName; InitiativeCardViewModel initCardViewModel = InitiativeCardViewModelFactory.GetInitiativeCardViewModel(actorViewModel); AddInitiativeCard(initCardViewModel); }
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); } } }
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); } }
public void Delete(InitiativeCardViewModel initCardViewModel) { InitiativeTrack.Remove(initCardViewModel); }