public override int OnChooseInformation(InformationInstance[] informations) { string[] texts = informations.Select(info => info.Description).ToArray(); TextTopBottomButton view = new TextTopBottomButton(null, this, "Choose an information...", texts, null, notificator); main.LaunchView(view); return view.SelectedIndex; }
public virtual void OnLearnInformation(InformationInstance info) { throw new NotImplementedException(); }
public virtual int OnChooseInformation(InformationInstance[] knownInformation) { throw new NotImplementedException(); }
public bool AddInformation(InformationInstance info) { //You can't learn about something you actually did. if (history.Contains(info)) return false; if (KnownInformation.Contains(info)) return false; KnownInformation.Add(info); //We've just learned an info. OnLearnInformation(info); return true; }
public void AddHistory(InformationInstance info) { history.Add(info); if (history.Count > 1) return; }
public double Evaluate(Game game, EventContext context, Weights weights) { Dictionary<string, object> computedParameters = new Dictionary<string, object>(); foreach (var pair in parameters) { computedParameters.Add(pair.Key, context.GetScopedObjectByName(pair.Value)); } InformationInstance info = new InformationInstance(game.GetInformationById(informationId), computedParameters, game.CurrentTime); return weights.MeasureObserveInformation(info, game, context.CurrentCharacter); }
public double MeasureObserveInformation(InformationInstance info, Game game, Character observingCharacter) { // 1. Is info about the perspective character // then we like it as much as we like whatever the OnObserve of that information does. if (info.IsAbout(Perspective)) { return info.EvaluateOnObserve(Perspective, Perspective, game); } else if (observingCharacter == Perspective) { return 100.0; // It's good to know things about people. } else { return 0.0; // Don't care about other people learning random information } }
public void AddObservableInfo(InformationInstance ii, int chance, Character teller) { ObservableInformation info = new ObservableInformation() { Info = ii, Chance = chance, Teller = teller }; information.Add(info); }
public override void OnLearnInformation(InformationInstance info) { notificator.AddNotification(info); }