public static void addIndex(Trait trait) { Index index = new Index(); trait.index.Add(index); index.name = "Index " + trait.index.Count; index.value = 0; }
//Value getters (return bool for success)/////////////////////////// private bool getINDEX(String line) { trim(ref line, ' '); String[] parts = line.Split(','); if (parts.Length > 1) { indexValue = new Index(); indexValue.name = parts[0]; filterNN(ref parts[1]); return int.TryParse(parts[1], out indexValue.value); } else { return false; } }
public Index clone() { Index index = new Index(); index.name = this.name; index.value = this.value; return index; }
//called by form IndexGenerator.cs public static void genIndex(Trait trait, int count, int start, int seperation, String prefix) { for (int i = 0; i < count; i++) { Index index = new Index(); index.name = prefix + " " + (i + 1).ToString(); index.value = start + (seperation * i); trait.index.Add(index); } }