setFrom method

void setFrom(
  1. String key,
  2. int index,
  3. num number
)

Implementation

void setFrom(String key, int index, num number){
  switch (key) {
    case "setX":
      setX(index,number);
      break;
    case "setY":
      setY(index,number);
      break;
    case "setZ":
      setZ(index,number);
      break;
    default:
    throw('missing $key');
  }
}