public OperatorDim(DimensionOperator op, BaseDim left, BaseDim right) { d_left = left != null?left.Clone() : null; d_right = right != null?right.Clone() : null; d_op = op; }
/// <summary> /// set the current value for this Dimension. /// </summary> /// <param name="dim"> /// object based on a subclass of BaseDim which holds the dimensional value. /// </param> public void SetBaseDimension(BaseDim dim) { // TODO: ... // release old value, if any. //if (d_value) // CEGUI_DELETE_AO d_value; _value = dim.Clone(); }
//! helper to set the next free operand, will throw after 2 are set public void SetNextOperand(BaseDim operand) { if (d_left == null) { d_left = operand != null?operand.Clone() : null; } else if (d_right == null) { d_right = operand != null?operand.Clone() : null; } else { throw new InvalidRequestException("Both operands are already set."); } }
//! set the right hand side operand (passed object is cloned) public void SetRightOperand(BaseDim operand) { // TODO: CEGUI_DELETE_AO d_right; d_right = operand != null?operand.Clone() : null; }
// TODO: ... //~OperatorDim() //{ // CEGUI_DELETE_AO d_right; // CEGUI_DELETE_AO d_left; //} //! set the left hand side operand (passed object is cloned) public void SetLeftOperand(BaseDim operand) { // TODO: CEGUI_DELETE_AO d_left; d_left = operand != null?operand.Clone() : null; }
// TODO: ... //~Dimension() //{ // if (d_value) // CEGUI_DELETE_AO d_value; //} // TODO: ... //Dimension(const Dimension& other) //{ // d_value = other.d_value ? other.d_value->clone() : 0; // d_type = other.d_type; //} // TODO: ... //Dimension& operator=(const Dimension& other) //{ // // release old value, if any. // if (d_value) // CEGUI_DELETE_AO d_value; // d_value = other.d_value ? other.d_value->clone() : 0; // d_type = other.d_type; // return *this; //} /// <summary> /// Constructor /// </summary> /// <param name="dim"> /// object based on subclass of BaseDim which holds the dimensional value. /// </param> /// <param name="type"> /// DimensionType value indicating what dimension this object is to represent. /// </param> public Dimension(BaseDim dim, DimensionType type) { _value = dim.Clone(); _type = type; }