public ViewModelWindowTechnologies() { this.CommandCloseDetails = new ActionCommand(this.CloseDetails); var tiers = new List <ViewModelTechTier>(); for (var tierIndex = (byte)TechConstants.MinTier; tierIndex <= (byte)TechConstants.MaxTier; tierIndex++) { tiers.Add(new ViewModelTechTier((TechTier)tierIndex)); } this.Tiers = tiers; this.SelectedTier = tiers[0]; this.technologies = ClientComponentTechnologiesWatcher.CurrentTechnologies; this.technologies.ClientSubscribe( _ => _.LearningPoints, _ => this.NotifyPropertyChanged(nameof(this.LearningPoints)), this); this.technologies.Groups.ClientElementInserted += this.GroupInserted; ClientCurrentCharacterHelper.PrivateState.ClientSubscribe( _ => _.FinalStatsCache, _ => this.NotifyPropertyChanged( nameof(this.LearningPointsRetainedAfterDeath)), this); }
private static void GameInitHandler(ICharacter character) { playerTechnologies = PlayerCharacter.GetPrivateState(character).Technologies; stateSubscriptionStorage = new StateSubscriptionStorage(); lastLearningPoints = playerTechnologies.LearningPoints; playerTechnologies.ClientSubscribe( t => t.LearningPoints, LearningPointsChangedHandler, stateSubscriptionStorage); }
public ViewModelWindowTechnologies() { this.CommandCloseDetails = new ActionCommand(this.CloseDetails); var tiers = new List <ViewModelTechTier>(); for (var tierIndex = (byte)TechConstants.MinTier; tierIndex <= (byte)TechConstants.MaxTier; tierIndex++) { tiers.Add(new ViewModelTechTier((TechTier)tierIndex)); } this.Tiers = tiers; this.SelectedTier = tiers[0]; this.technologies = ClientComponentTechnologiesWatcher.CurrentTechnologies; this.technologies.ClientSubscribe( _ => _.LearningPoints, _ => this.NotifyPropertyChanged(nameof(this.LearningPoints)), this); }
public CharacterContext(ICharacter playerCharacter) { this.Character = playerCharacter; this.technologies = null; }