Inheritance: XmlBrick, IIfBrick
 public override void LoadReference()
 {
     if(IfLogicBeginBrick == null)
         IfLogicBeginBrick = ReferenceHelper.GetReferenceObject(this, _reference) as XmlIfLogicBeginBrick;
     if (string.IsNullOrEmpty(_reference))
         _reference = ReferenceHelper.GetReferenceString(this);
 }
 public override void LoadReference()
 {
     if (IfLogicBeginBrick == null)
     {
         IfLogicBeginBrick = ReferenceHelper.GetReferenceObject(this, _reference) as XmlIfLogicBeginBrick;
     }
     if (string.IsNullOrEmpty(_reference))
     {
         _reference = ReferenceHelper.GetReferenceString(this);
     }
 }
        public void XmlIfLogicBeginBrickTest()
        {
            TextReader sr = new StringReader("<brick type=\"IfLogicBeginBrick\"><formulaList><formula category=\"IF_CONDITION\"><type>USER_VARIABLE</type><value>Opponent was hit!</value></formula></formulaList></brick>");
            var xRoot = XElement.Load(sr);

            var testObject = new XmlIfLogicBeginBrick(xRoot);

            var referenceObject = new XmlIfLogicBeginBrick()
            {
                IfCondition = new XmlFormula(xRoot, XmlConstants.XmlIFCONDITION),
            };

            Assert.AreEqual(referenceObject, testObject);
        }
 public bool Equals(XmlIfLogicBeginBrick b)
 {
     return this.Equals((XmlBrick)b) && this.IfCondition.Equals(b.IfCondition);
 }