public override ErrorList Validate()
            {
                var result = new ErrorList();

                result.AddRange(base.Validate());

                if (SystemElement != null)
                {
                    result.AddRange(SystemElement.Validate());
                }
                if (VersionElement != null)
                {
                    result.AddRange(VersionElement.Validate());
                }
                if (CodeElement != null)
                {
                    CodeElement.ForEach(elem => result.AddRange(elem.Validate()));
                }
                if (Filter != null)
                {
                    Filter.ForEach(elem => result.AddRange(elem.Validate()));
                }

                return(result);
            }
Beispiel #2
0
    private void ShowSystemElementView(SystemElementController elementController)
    {
        SystemElement      systemElement = elementController.SystemElement;
        ISystemElementView selectedView;

        if (systemElement.IsDestroyed)
        {
            selectedView = systemElementDestroyedView;
        }
        else if (systemElement.IsHacked)
        {
            selectedView = systemElementHackedView;
        }
        else
        {
            selectedView = systemElementView;
        }

        if (currentView != null && currentView != selectedView)
        {
            currentView.Hide();
        }

        currentView = selectedView;
        currentView.Show(elementController);
    }
Beispiel #3
0
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (ValueElement != null)
            {
                result.AddRange(ValueElement.Validate());
            }
            if (ComparatorElement != null)
            {
                result.AddRange(ComparatorElement.Validate());
            }
            if (UnitsElement != null)
            {
                result.AddRange(UnitsElement.Validate());
            }
            if (SystemElement != null)
            {
                result.AddRange(SystemElement.Validate());
            }
            if (CodeElement != null)
            {
                result.AddRange(CodeElement.Validate());
            }

            return(result);
        }
            public override ErrorList Validate()
            {
                var result = new ErrorList();

                result.AddRange(base.Validate());

                if (SystemElement != null)
                {
                    result.AddRange(SystemElement.Validate());
                }
                if (CodeElement != null)
                {
                    result.AddRange(CodeElement.Validate());
                }
                if (DisplayElement != null)
                {
                    result.AddRange(DisplayElement.Validate());
                }
                if (Contains != null)
                {
                    Contains.ForEach(elem => result.AddRange(elem.Validate()));
                }

                return(result);
            }
Beispiel #5
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as ConceptMapConceptMapComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (SystemElement != null)
                    {
                        dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy();
                    }
                    if (CodeElement != null)
                    {
                        dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy();
                    }
                    if (EquivalenceElement != null)
                    {
                        dest.EquivalenceElement = (Code <Hl7.Fhir.Model.ConceptMap.ConceptMapEquivalence>)EquivalenceElement.DeepCopy();
                    }
                    if (CommentsElement != null)
                    {
                        dest.CommentsElement = (Hl7.Fhir.Model.FhirString)CommentsElement.DeepCopy();
                    }
                    if (Product != null)
                    {
                        dest.Product = new List <Hl7.Fhir.Model.ConceptMap.OtherConceptComponent>(Product.DeepCopy());
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }
Beispiel #6
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as ConceptMapConceptComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (SystemElement != null)
                    {
                        dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy();
                    }
                    if (CodeElement != null)
                    {
                        dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy();
                    }
                    if (DependsOn != null)
                    {
                        dest.DependsOn = new List <Hl7.Fhir.Model.ConceptMap.OtherConceptComponent>(DependsOn.DeepCopy());
                    }
                    if (Map != null)
                    {
                        dest.Map = new List <Hl7.Fhir.Model.ConceptMap.ConceptMapConceptMapComponent>(Map.DeepCopy());
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (SystemElement != null)
            {
                result.AddRange(SystemElement.Validate());
            }
            if (ValueElement != null)
            {
                result.AddRange(ValueElement.Validate());
            }
            if (UseElement != null)
            {
                result.AddRange(UseElement.Validate());
            }
            if (Period != null)
            {
                result.AddRange(Period.Validate());
            }

            return(result);
        }
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Quantity;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (ValueElement != null)
                {
                    dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy();
                }
                if (ComparatorElement != null)
                {
                    dest.ComparatorElement = (Code <Hl7.Fhir.Model.Quantity.QuantityComparator>)ComparatorElement.DeepCopy();
                }
                if (UnitElement != null)
                {
                    dest.UnitElement = (Hl7.Fhir.Model.FhirString)UnitElement.DeepCopy();
                }
                if (SystemElement != null)
                {
                    dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy();
                }
                if (CodeElement != null)
                {
                    dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
            public override ErrorList Validate()
            {
                var result = new ErrorList();

                result.AddRange(base.Validate());

                if (TypeElement != null)
                {
                    result.AddRange(TypeElement.Validate());
                }
                if (UnitsElement != null)
                {
                    result.AddRange(UnitsElement.Validate());
                }
                if (UcumElement != null)
                {
                    result.AddRange(UcumElement.Validate());
                }
                if (Template != null)
                {
                    result.AddRange(Template.Validate());
                }
                if (SystemElement != null)
                {
                    result.AddRange(SystemElement.Validate());
                }

                return(result);
            }
Beispiel #10
0
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (UseElement != null)
            {
                result.AddRange(UseElement.Validate());
            }
            if (LabelElement != null)
            {
                result.AddRange(LabelElement.Validate());
            }
            if (SystemElement != null)
            {
                result.AddRange(SystemElement.Validate());
            }
            if (KeyElement != null)
            {
                result.AddRange(KeyElement.Validate());
            }
            if (Period != null)
            {
                result.AddRange(Period.Validate());
            }
            if (Assigner != null)
            {
                result.AddRange(Assigner.Validate());
            }

            return(result);
        }
Beispiel #11
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Coding;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (SystemElement != null)
            {
                dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy();
            }
            if (VersionElement != null)
            {
                dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy();
            }
            if (CodeElement != null)
            {
                dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy();
            }
            if (DisplayElement != null)
            {
                dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy();
            }
            if (UserSelectedElement != null)
            {
                dest.UserSelectedElement = (Hl7.Fhir.Model.FhirBoolean)UserSelectedElement.DeepCopy();
            }
            return(dest);
        }
Beispiel #12
0
    public void Show(SystemElementController elementController)
    {
        this.elementController = elementController;
        systemElement          = elementController.SystemElement;

        UpdateView();

        gameObject.SetActive(true);
        fader.Fade(1f);
    }
Beispiel #13
0
    public void Hide()
    {
        if (gameObject.activeInHierarchy)
        {
            fader.Fade(0f);
        }

        elementController = null;
        systemElement     = null;
    }
Beispiel #14
0
    public void OnElementGenerated(GeneratedElementInfo elementInfo)
    {
        SystemElement systemElement = InstantiateSystemElement(ref elementInfo);

        systemElementList.Value.Add(systemElement);

        SystemElementController elementController = Instantiate(systemElementPrefab, transform);

        elementController.transform.position = elementInfo.Position;
        elementController.SystemElement      = systemElement;
        elementController.Tiles  = elementInfo.Tiles;
        systemElement.Controller = elementController;
    }
Beispiel #15
0
    public void Show(SystemElementController elementController)
    {
        this.elementController = elementController;
        systemElement          = elementController.SystemElement;

        nameText.text = systemElement.Name;

        playerImage.color = systemElement.OwnerVirus.Color;
        playerText.text   = systemElement.OwnerVirus.Name;

        gameObject.SetActive(true);
        fader.Fade(1f);
    }
        public IEnumerable <SystemElement> GetAll()
        {
            if ((from t in _connection.Table <SystemElement>() select t).ToList().Count == 0)
            {
                List <SystemElement> SystemElementList = new List <SystemElement>();
                SystemElement        SE = new SystemElement();
                SE.SystemElementID   = 0;
                SE.SystemElementName = "No Record Found";
                SystemElementList.Add(SE);

                SE = new SystemElement();
                SE.SystemElementID   = 1;
                SE.SystemElementName = "My System Element";
                SystemElementList.Add(SE);
                return(SystemElementList);
            }

            return((from t in _connection.Table <SystemElement>() select t).ToList());
        }
            public override ErrorList Validate()
            {
                var result = new ErrorList();

                result.AddRange(base.Validate());

                if (SystemElement != null)
                {
                    result.AddRange(SystemElement.Validate());
                }
                if (CaseSensitiveElement != null)
                {
                    result.AddRange(CaseSensitiveElement.Validate());
                }
                if (Concept != null)
                {
                    Concept.ForEach(elem => result.AddRange(elem.Validate()));
                }

                return(result);
            }
Beispiel #18
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Identifier;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (UseElement != null)
                {
                    dest.UseElement = (Code <Hl7.Fhir.Model.Identifier.IdentifierUse>)UseElement.DeepCopy();
                }
                if (Type != null)
                {
                    dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
                }
                if (SystemElement != null)
                {
                    dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy();
                }
                if (ValueElement != null)
                {
                    dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy();
                }
                if (Period != null)
                {
                    dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy();
                }
                if (Assigner != null)
                {
                    dest.Assigner = (Hl7.Fhir.Model.ResourceReference)Assigner.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
Beispiel #19
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Coding;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (SystemElement != null)
                {
                    dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy();
                }
                if (VersionElement != null)
                {
                    dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy();
                }
                if (CodeElement != null)
                {
                    dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy();
                }
                if (DisplayElement != null)
                {
                    dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy();
                }
                if (PrimaryElement != null)
                {
                    dest.PrimaryElement = (Hl7.Fhir.Model.FhirBoolean)PrimaryElement.DeepCopy();
                }
                if (ValueSet != null)
                {
                    dest.ValueSet = (Hl7.Fhir.Model.ResourceReference)ValueSet.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as ContactPoint;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (SystemElement != null)
            {
                dest.SystemElement = (Code <Hl7.Fhir.Model.ContactPoint.ContactPointSystem>)SystemElement.DeepCopy();
            }
            if (ValueElement != null)
            {
                dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy();
            }
            if (UseElement != null)
            {
                dest.UseElement = (Code <Hl7.Fhir.Model.ContactPoint.ContactPointUse>)UseElement.DeepCopy();
            }
            if (RankElement != null)
            {
                dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopy();
            }
            if (Period != null)
            {
                dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy();
            }
            return(dest);
        }
        internal static void Sort(SystemElement[] elements)
        {
            lookupDictionary = null;
            var sortedElements = new SystemElement[elements.Length];
            int nextOutIndex   = 0;

            var readySystems = new Heap(elements.Length);

            for (int i = 0; i < elements.Length; ++i)
            {
                if (elements[i].nAfter == 0)
                {
                    readySystems.Insert(new TypeHeapElement(i, elements[i].Type));
                }
            }

            while (!readySystems.Empty)
            {
                var sysIndex = readySystems.Extract().unsortedIndex;
                var elem     = elements[sysIndex];

                sortedElements[nextOutIndex++] = new SystemElement
                {
                    Type  = elem.Type,
                    Index = elem.Index,
                };
                foreach (var beforeType in elem.updateBefore)
                {
                    int beforeIndex = LookupSystemElement(beforeType, elements);
                    if (beforeIndex < 0)
                    {
                        throw new Exception("Bug in SortSystemUpdateList(), beforeIndex < 0");
                    }
                    if (elements[beforeIndex].nAfter <= 0)
                    {
                        throw new Exception("Bug in SortSystemUpdateList(), nAfter <= 0");
                    }

                    elements[beforeIndex].nAfter--;
                    if (elements[beforeIndex].nAfter == 0)
                    {
                        readySystems.Insert(new TypeHeapElement(beforeIndex, elements[beforeIndex].Type));
                    }
                }
                elements[sysIndex].nAfter = -1; // "Remove()"
            }

#if ENABLE_UNITY_COLLECTIONS_CHECKS
            for (int i = 0; i < elements.Length; ++i)
            {
                if (elements[i].nAfter != -1)
                {
                    // Since no System in the circular dependency would have ever been added
                    // to the heap, we should have values for everything in sysAndDep. Check,
                    // just in case.
                    var visitedSystems = new List <Type>();
                    var startIndex     = i;
                    var currentIndex   = i;
                    while (true)
                    {
                        if (elements[currentIndex].nAfter != -1)
                        {
                            visitedSystems.Add(elements[currentIndex].Type);
                        }

                        currentIndex = LookupSystemElement(elements[currentIndex].updateBefore[0], elements);
                        if (currentIndex < 0 || currentIndex == startIndex || elements[currentIndex].nAfter == -1)
                        {
                            throw new CircularSystemDependencyException(visitedSystems);
                        }
                    }
                }
            }
#endif

            // Replace input array with sorted array
            for (int i = 0; i < elements.Length; ++i)
            {
                elements[i] = sortedElements[i];
            }
        }
        public void VisitSystem()
        {
            System.String str = "some string";

            SystemElement elem = new SystemElement("str", str);

            PlainTextVisitor visitor = new PlainTextVisitor(_writer);
            elem.Visit(visitor);

            _stream.Seek(0, SeekOrigin.Begin);
            StreamReader reader = new StreamReader(_stream);
            string actual = reader.ReadToEnd();

            string expected = "Class: String, Name: str, Value: some string\r\n";

            Assert.AreEqual(expected, actual);
        }
 public void Add(SystemElement s)
 {
     _connection.Insert(s);
 }
 public void Update(SystemElement s)
 {
     _connection.Update(s);
 }