Пример #1
0
 private void addNewItem(GurpsProperty property)
 {
     using (new LayoutSuspender(table))
     {
         table.Controls.Remove(newItemTextBox);
         layout.names.Add(property.name);
         layout.names.Sort();
         characterSheet.Character.raiseChanged();
         refreshRows();
     }
 }
Пример #2
0
 protected Effect(GurpsProperty owner, string traitName, Formula formula, ParsedThing parsedThing)
 {
     this.owner = owner;
     this.traitName = traitName;
     this.formula = formula;
     this.parsedThing = parsedThing;
 }
Пример #3
0
 public abstract void checkFormula(Dictionary<string, GurpsProperty> nameToThing, GurpsProperty affectedProperty);
Пример #4
0
 public CostModifier(GurpsProperty owner, string traitName, Formula formula, ParsedThing parsedThing)
     : base(owner, traitName, formula, parsedThing)
 {
 }
Пример #5
0
 public override void checkFormula(Dictionary<string, GurpsProperty> nameToThing, GurpsProperty affectedProperty)
 {
     if (affectedProperty is AttributeFunction) // TODO: use hasCost or whatever
         throw parsedThing.createError("Cannot modify the cost of a trait with no cost");
     formula.checkIsPercent(new CheckingContext(nameToThing, owner));
 }
Пример #6
0
 private bool isInt(GurpsProperty property)
 {
     return property is IntAdvantage || property is AttributeFunction || property is AbstractSkill;
 }
Пример #7
0
 public CheckingContext(Dictionary<string, GurpsProperty> nameToThing, GurpsProperty enclosingProperty)
 {
     this.nameToThing = nameToThing;
     this.enclosingProperty = enclosingProperty;
 }
Пример #8
0
 public override void checkFormula(Dictionary<string, GurpsProperty> nameToThing, GurpsProperty affectedProperty)
 {
     if (affectedProperty is BooleanAdvantage) // TODO: use hasLevels or whatever
         throw parsedThing.createError("Cannot modify the level of a trait with no level");
     formula.checkIsInt(new CheckingContext(nameToThing, owner));
 }
Пример #9
0
 public PurchasedProperty(GurpsProperty property, GurpsCharacter character)
 {
     this.property = property;
     this.character = character;
 }
Пример #10
0
 private static bool filterPasses(TraitTypeFilter filter, GurpsProperty property)
 {
     switch (filter)
     {
         case TraitTypeFilter.Locked: return true;
         case TraitTypeFilter.Skills:
             return property is AbstractSkill && !((AbstractSkill)property).category;
         case TraitTypeFilter.Advantages:
             return property is Advantage && isAdvantageNonNegative((Advantage)property);
         case TraitTypeFilter.Disadvantages:
             return property is Advantage && !isAdvantageNonNegative((Advantage)property);
     }
     throw null;
 }