Beispiel #1
0
        public void Setup()
        {
            m_worldModel = new WorldModel();

            m_original = m_worldModel.GetElementFactory(ElementType.Object).Create("original");
            m_original.Fields.Set(attributeName, attributeValue);
            m_original.Fields.Set(listAttributeName, new QuestList<string>(listAttributeValue));
            m_original.Fields.Resolve(null);
            Assert.AreEqual(attributeValue, m_original.Fields.GetString(attributeName));
            Assert.AreEqual(3, m_original.Fields.GetAsType<QuestList<string>>(listAttributeName).Count);
        }
Beispiel #2
0
        public void Setup()
        {
            const string inheritedTypeName = "inherited";
            const string subInheritedTypeName = "subtype";
            const string defaultObject = "defaultobject";

            m_worldModel = new WorldModel();

            m_defaultType = m_worldModel.GetElementFactory(ElementType.ObjectType).Create(defaultObject);
            m_defaultType.Fields.Set(attributeDefinedByDefaultName, attributeDefinedByDefaultValue);
            m_defaultType.Fields.Set(attributeDefinedByDefault2Name, attributeDefinedByDefault2Value);

            m_subType = m_worldModel.GetElementFactory(ElementType.ObjectType).Create(subInheritedTypeName);
            m_subType.Fields.Set(inheritedAttribute2Name, inheritedAttribute2Value);
            m_subType.Fields.Set(attributeDefinedByDefault2Name, attributeDefinedByDefault2OverriddenValue);

            m_objectType = m_worldModel.GetElementFactory(ElementType.ObjectType).Create(inheritedTypeName);
            m_objectType.Fields.Set(inheritedAttributeName, inheritedAttributeValue);
            m_objectType.Fields.AddType(m_subType);

            m_object = m_worldModel.GetElementFactory(ElementType.Object).Create("object");
            m_object.Fields.Resolve(null);
            m_object.Fields.AddType(m_objectType);
        }
Beispiel #3
0
        public void Setup()
        {
            m_worldModel = new WorldModel();

            // a
            // - b
            //   - c
            //   - d
            // - e
            // f

            Element a = m_worldModel.GetElementFactory(ElementType.Object).Create("a");
            Element b = m_worldModel.GetElementFactory(ElementType.Object).Create("b");
            b.Parent = a;
            Element c = m_worldModel.GetElementFactory(ElementType.Object).Create("c");
            c.Parent = b;
            Element d = m_worldModel.GetElementFactory(ElementType.Object).Create("d");
            d.Parent = b;
            Element e = m_worldModel.GetElementFactory(ElementType.Object).Create("e");
            e.Parent = a;
            Element f = m_worldModel.GetElementFactory(ElementType.Object).Create("f");
        }