public PatternHair(PatternHair rvalue) { colorList = new HSVColor[MAX_PATTERN_COUNT]; for (int i = 0; i < colorList.Length; i++) { colorList[i] = rvalue.colorList[i].Clone(); } patternCount = rvalue.patternCount; }
public override IHairType CreateNew(string str) { PatternHair returnV = new PatternHair(); string[] tokens = str.Split(','); if (tokens.Length < 1) //no length paramter { return(returnV); } returnV.patternCount = int.Parse(tokens[0]); for (int i = 0; i < returnV.patternCount && i < returnV.colorList.Length && i + 1 < tokens.Length; i++) { returnV.colorList[i] = new HSVColor(tokens[i + 1]); } return(returnV); }