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(); } }
protected Effect(GurpsProperty owner, string traitName, Formula formula, ParsedThing parsedThing) { this.owner = owner; this.traitName = traitName; this.formula = formula; this.parsedThing = parsedThing; }
public abstract void checkFormula(Dictionary<string, GurpsProperty> nameToThing, GurpsProperty affectedProperty);
public CostModifier(GurpsProperty owner, string traitName, Formula formula, ParsedThing parsedThing) : base(owner, traitName, formula, parsedThing) { }
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)); }
private bool isInt(GurpsProperty property) { return property is IntAdvantage || property is AttributeFunction || property is AbstractSkill; }
public CheckingContext(Dictionary<string, GurpsProperty> nameToThing, GurpsProperty enclosingProperty) { this.nameToThing = nameToThing; this.enclosingProperty = enclosingProperty; }
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)); }
public PurchasedProperty(GurpsProperty property, GurpsCharacter character) { this.property = property; this.character = character; }
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; }