private void DoMatchReplace(Crate crate) { for(int i = 0; i < crate.Features.Count; i++) { if(crate.Features[i].Matches(MatchFeature)) { CrateFeature newFeature = new CrateFeature(crate.Features[i]); if(ReplaceFeature.Color != CrateFeature.ColorWildcard) { newFeature.Color = ReplaceFeature.Color; } if(ReplaceFeature.Shape != CrateFeature.ShapeWildcard) { newFeature.Shape = ReplaceFeature.Shape; } crate.Features[i] = newFeature; } } }
public MatchReplaceRule(CrateFeature match, CrateFeature replace) { MatchFeature = match; ReplaceFeature = replace; }
public static Sprite GetSprite(CrateFeature f) { return instance.shapes[f.Shape].colors[f.Color]; }