Example #1
0
 public Event(string id, string desc, ILogic requirements, IExecute dirExec, EventOption[] options, Parameter[] parameters)
 {
     Identifier = id;
     Description = desc;
     ActionRequirements = requirements;
     DirectExecute = dirExec;
     Options = options;
     Parameters = parameters;
 }
 public override int OnChooseOption(EventOption[] options, int[] willpowerCost, EventContext context, Event e)
 {
     string[] texts = new string[options.Length];
     for(int i = 0; i < options.Length; ++i)
     {
         if (willpowerCost[i] > 0)
         {
             texts[i] = EventHelper.ReplaceStrings(options[i].Label, context) + " (Cost: " + willpowerCost[i] + " WP)";
         }
         else
             texts[i] = EventHelper.ReplaceStrings(options[i].Label, context);
     }
     bool[] enabled = willpowerCost.Select(cost => cost <= WillPower).ToArray();
     TextTopBottomButton view = new TextTopBottomButton(context.GetCharacters(), this, e.CreateActionDescription(context), texts, enabled, notificator);
     main.LaunchView(view);
     return view.SelectedIndex;
 }
Example #3
0
 public virtual int OnChooseOption(EventOption[] options, int[] willpowerCost, EventContext context, Event e)
 {
     throw new NotImplementedException();
 }
Example #4
0
 public int ChooseOption(EventOption[] options, int[] willpowerCost, EventContext context, Event e)
 {
     return OnChooseOption(options, willpowerCost, context, e);
 }