private int GetVectorGroupKey(WindingConfiguration primary, WindingConfiguration secondary, int displacement) { int primaryKey = GetConfigurationKey(primary); int secondaryKey = GetConfigurationKey(secondary); return(primaryKey * 16 + secondaryKey + displacement * 256); }
private int GetConfigurationKey(WindingConfiguration configuration) { switch (configuration) { case WindingConfiguration.D: return(1); case WindingConfiguration.Y: return(2); case WindingConfiguration.Yn: return(3); case WindingConfiguration.Z: return(4); case WindingConfiguration.Zn: return(5); default: throw new InvalidCastException(); } }
public ICommand CreateSetConfigurationCommand(WindingConfiguration primary, int displacement) { return(new CommandSetConfiguration(primary, displacement)); }
public CommandSetConfiguration(WindingConfiguration primary, int displacement) { this.vectorGroupKey = GetVectorGroupKey(primary, displacement); }