public void setValue(ICommandInterpreter cmd) { T new_val; string svalue = cmd.getArgument(0); if (!parseValue(svalue, out new_val)) { cmd.Error("Invalid variable value"); return; } if (!m_value.Equals(new_val) && (m_delegate == null || m_delegate(m_value, new_val))) { m_value = new_val; } }