public void AddRule(TileRule rule) { List<TileRule> r = new List<TileRule>(); if (this.rules != null) r.AddRange(this.rules); r.Add(rule); this.rules = r.ToArray(); }
public void AddRule(TileRule rule) { List <TileRule> r = new List <TileRule>(); if (this.rules != null) { r.AddRange(this.rules); } r.Add(rule); this.rules = r.ToArray(); }
public TileRuleMultipleOnlyOne(bool useRandom, TileRule[] otherRules, TileRuleCondition condition) : base(condition) { this.otherRules = otherRules; this.useRandom = useRandom; }
public TileRuleMultiple(TileRule[] otherRules, TileRuleCondition condition) : base(condition) { this.otherRules = otherRules; }
private void ExecuteTileRule(TilePosition pos, Tile tile, TileRule rule) { world.stats.executedRules++; if (rule.CheckConditions(this, tile, pos)) rule.Execute(this, tile, pos); }
private void ExecuteTileRules(TilePosition pos, Tile tile, TileRule[] rules) { world.stats.executedRules += rules.Length; foreach (TileRule rule in rules) { if (rule.CheckConditions(this, tile, pos)) { rule.Execute(this, tile, pos); if (GetTileType(pos) != tile.tileType) break; } } }