Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 public virtual void OnLearnInformation(InformationInstance info)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 3
0
 public virtual int OnChooseInformation(InformationInstance[] knownInformation)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
        public void AddHistory(InformationInstance info)
        {
            history.Add(info);

            if (history.Count > 1)
                return;
        }
Exemplo n.º 6
0
 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);
 }
Exemplo n.º 7
0
 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
     }
 }
Exemplo n.º 8
0
 public void AddObservableInfo(InformationInstance ii, int chance, Character teller)
 {
     ObservableInformation info = new ObservableInformation()
     {
         Info = ii,
         Chance = chance,
         Teller = teller
     };
     information.Add(info);
 }
Exemplo n.º 9
0
 public override void OnLearnInformation(InformationInstance info)
 {
     notificator.AddNotification(info);
 }