private void ExecuteEditActor(object actorObj) { if (actorObj is Model.Actor) { CreateActorWindowViewModel createActorWindowViewModel = new CreateActorWindowViewModel(); if (actorObj is Model.PlayerActor) { createActorWindowViewModel.LoadPlayerActor(actorObj as Model.PlayerActor); Model.PlayerActor playerActor = createActorWindowViewModel.GetPlayerActor(); if (playerActor != null) { ActorLibrary.EditActor(actorObj as Model.PlayerActor, playerActor); Encounter.UpdateActor(actorObj as Model.PlayerActor); } } else if (actorObj is Model.Creature) { createActorWindowViewModel.LoadCreature(actorObj as Model.Creature); Model.Creature creature = createActorWindowViewModel.GetCreature(); if (creature != null) { ActorLibrary.EditActor(actorObj as Model.Creature, creature); } } } }
private void ExecuteCreateCreature() { CreateActorWindowViewModel createActorWindowViewModel = new CreateActorWindowViewModel(); Model.Creature creature = createActorWindowViewModel.GetCreature(); if (creature != null) { ActorLibrary.AddActor(creature); } }