コード例 #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
ファイル: Gurpenator.cs プロジェクト: thejoshwolfe/Gurpenator
 protected Effect(GurpsProperty owner, string traitName, Formula formula, ParsedThing parsedThing)
 {
     this.owner = owner;
     this.traitName = traitName;
     this.formula = formula;
     this.parsedThing = parsedThing;
 }
コード例 #3
0
ファイル: Gurpenator.cs プロジェクト: thejoshwolfe/Gurpenator
 public abstract void checkFormula(Dictionary<string, GurpsProperty> nameToThing, GurpsProperty affectedProperty);
コード例 #4
0
ファイル: Gurpenator.cs プロジェクト: thejoshwolfe/Gurpenator
 public CostModifier(GurpsProperty owner, string traitName, Formula formula, ParsedThing parsedThing)
     : base(owner, traitName, formula, parsedThing)
 {
 }
コード例 #5
0
ファイル: Gurpenator.cs プロジェクト: thejoshwolfe/Gurpenator
 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
ファイル: Gurpenator.cs プロジェクト: thejoshwolfe/Gurpenator
 private bool isInt(GurpsProperty property)
 {
     return property is IntAdvantage || property is AttributeFunction || property is AbstractSkill;
 }
コード例 #7
0
ファイル: Gurpenator.cs プロジェクト: thejoshwolfe/Gurpenator
 public CheckingContext(Dictionary<string, GurpsProperty> nameToThing, GurpsProperty enclosingProperty)
 {
     this.nameToThing = nameToThing;
     this.enclosingProperty = enclosingProperty;
 }
コード例 #8
0
ファイル: Gurpenator.cs プロジェクト: thejoshwolfe/Gurpenator
 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
ファイル: Gurpenator.cs プロジェクト: thejoshwolfe/Gurpenator
 public PurchasedProperty(GurpsProperty property, GurpsCharacter character)
 {
     this.property = property;
     this.character = character;
 }
コード例 #10
0
ファイル: Gurpenator.cs プロジェクト: thejoshwolfe/Gurpenator
 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;
 }