Esempio n. 1
0
        protected override void Embed(ExtensibleData value)
        {
            Discussion     discussion = value as Discussion;
            List <Comment> comments   = discussion.Comments;

            if (comments != null)
            {
                foreach (Comment comment in comments)
                {
                    bool found = false;
                    if (comment.Id != null)
                    {
                        if (Comments != null)
                        {
                            foreach (Comment target in Comments)
                            {
                                if (comment.Id.Equals(target.Id))
                                {
                                    target.EmbedInt(comment);
                                    found = true;
                                    break;
                                }
                            }
                        }
                    }

                    if (!found)
                    {
                        AddComment(comment);
                    }
                }
            }

            base.Embed(discussion);
        }
Esempio n. 2
0
 protected void BindIfNeeded(ExtensibleData candidate)
 {
     if (resource == null && this.resourceId.Equals(candidate.Id))
     {
         this.resource = candidate;
     }
 }
 protected void BindIfNeeded(ExtensibleData candidate)
 {
     if (resource == null && this.resourceId.Equals(candidate.Id))
     {
         this.resource = candidate;
     }
 }
    public override void Initialize(int ownerUniqueID)
    {
        this.ownerUniqueID = ownerUniqueID;
        identifier         = PStrings.pathfindManager;

        owner = GridData.GetExtensible(ownerUniqueID);

        index = 0;
        path  = null;

        pathRequested   = false;
        nextPathRequest = Metrics.time;
    }
Esempio n. 5
0
    public override void Initialize(int ownerUniqueID)
    {
        this.ownerUniqueID = ownerUniqueID;
        identifier         = PStrings.waypointManager;

        owner = GridData.GetExtensible(ownerUniqueID);

        index     = 0;
        waypoints = new List <WaypointData>();

        circular     = false;
        pointHold    = true;
        endHold      = false;
        pointHoldFor = 5f;
        endHoldFor   = 5f;
    }
Esempio n. 6
0
    public void SetTarget(int uniqueID)
    {
        target = GridData.GetExtensible(uniqueID);
        if (target != null)
        {
            targetUniqueID = target.uniqueID;
        }
        else
        {
            targetUniqueID = -1;
            return;
        }

        if (switchT == null)
        {
            return;
        }

        DoorData doorData = (DoorData)target.GetExtension(PStrings.door);

        if (doorData == null)
        {
            return;
        }

        if (doorData.key == DoorKey.Null)
        {
            offMaterial = Statics.green;
            onMaterial  = Statics.greenLight;
        }
        else if (doorData.key == DoorKey.RedCard || doorData.key == DoorKey.RedSkull)
        {
            offMaterial = Statics.red;
            onMaterial  = Statics.redLight;
        }
        else if (doorData.key == DoorKey.BlueCard || doorData.key == DoorKey.BlueSkull)
        {
            offMaterial = Statics.blue;
            onMaterial  = Statics.blueLight;
        }
        else if (doorData.key == DoorKey.YellowCard || doorData.key == DoorKey.YellowSkull)
        {
            offMaterial = Statics.yellow;
            onMaterial  = Statics.yellowLight;
        }
    }
Esempio n. 7
0
        protected internal override void Embed(ExtensibleData data)
        {
            var value = (DisplayProperties)data;

            this._name              = this._name == null ? value._name : this._name;
            this._gender            = this._gender == null ? value._gender : this._gender;
            this._lifespan          = this._lifespan == null ? value._lifespan : this._lifespan;
            this._birthDate         = this._birthDate == null ? value._birthDate : this._birthDate;
            this._birthPlace        = this._birthPlace == null ? value._birthPlace : this._birthPlace;
            this._deathDate         = this._deathDate == null ? value._deathDate : this._deathDate;
            this._deathPlace        = this._deathPlace == null ? value._deathPlace : this._deathPlace;
            this._marriageDate      = this._marriageDate == null ? value._marriageDate : this._marriageDate;
            this._marriagePlace     = this._marriagePlace == null ? value._marriagePlace : this._marriagePlace;
            this._ascendancyNumber  = this._ascendancyNumber == null ? value._ascendancyNumber : this._ascendancyNumber;
            this._descendancyNumber = this._descendancyNumber == null ? value._descendancyNumber : this._descendancyNumber;
            base.Embed(data);
        }
Esempio n. 8
0
        private void SetValueForExamWorkSheet(byte[] value, IExamInfo examInfo)
        {
            CpuClock c = new CpuClock();

            try
            {
                using (_workSheetsOnExam.LockOnCollectionChanged())
                {
                    using (_fetalBPSInfoNodes.LockOnCollectionChanged())
                    {
                        _fetalBPSInfoNodes.Clear();
                        _workSheetsOnExam.Clear();
                        try
                        {
                            if (value != null && value.Length > 0)
                            {
                                ScanNodeContext context = new ScanNodeContext((ExamInfo)examInfo);

                                var extensibleData = ExtensibleData.DeSerialize(value, context);
                                if (extensibleData != null)
                                {
                                    _fetalBPSInfoNodes.AddRange(extensibleData.BpsNodes);
                                    _workSheetsOnExam.AddRange(extensibleData.ScanNodes);
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            _workSheetsOnExam.Clear();
                            _fetalBPSInfoNodes.Clear();
                            Logger.WriteLineError("Failed to parse ExtensibleData value, details:{0}.", ex);
                        }
                    }
                }
            }
            finally
            {
                if (c.TotalMilliSeconds >= 500)
                {
                    Logger.WriteLineError("ExamInfo.SetWorkSheetsXml spent {0:F2} ms", c.TotalMilliSeconds);
                }
            }
        }
        protected override void Embed(ExtensibleData relationship)
        {
            ChildAndParentsRelationship value = relationship as ChildAndParentsRelationship;

            if (value != null)
            {
                if (value.MotherFacts != null)
                {
                    this.MotherFacts = this.MotherFacts == null ? new List <Fact>() : this.MotherFacts;
                    this.MotherFacts.AddRange(value.MotherFacts);
                }
                if (value.FatherFacts != null)
                {
                    this.FatherFacts = this.FatherFacts == null ? new List <Fact>() : this.FatherFacts;
                    this.FatherFacts.AddRange(value.FatherFacts);
                }
            }

            base.Embed(relationship);
        }
Esempio n. 10
0
        protected internal override void Embed(ExtensibleData conclusion)
        {
            var value = (Conclusion)conclusion;

            this._lang        = this._lang == null ? value._lang : this._lang;
            this._confidence  = this._confidence == null ? value._confidence : this._confidence;
            this._attribution = this._attribution == null ? value._attribution : this._attribution;
            this._analysis    = this._analysis == null ? value._analysis : this._analysis;
            if (value._notes != null)
            {
                this._notes = this._notes == null ? new List <Note>() : this._notes;
                this._notes.AddRange(value._notes);
            }
            if (value._sources != null)
            {
                this._sources = this._sources == null ? new List <SourceReference>() : this._sources;
                this._sources.AddRange(value._sources);
            }
            base.Embed(conclusion);
        }
    private void Interact()
    {
        if (input.interactRequest == true)
        {
            CellData interactCell = GridData.GetCellAt(Coordinates.FromWorldSpace(input.interactPosition));

            if (interactCell != null)
            {
                ExtensibleData extensible = null;

                if (interactCell.obstacle != null)
                {
                    extensible = interactCell.obstacle;
                }
                else if (interactCell.item != null)
                {
                    extensible = interactCell.item;
                }
                else if (interactCell.entity != null)
                {
                    extensible = interactCell.entity;
                }

                if (extensible != null)
                {
                    InteractableData interactable = (InteractableData)extensible.GetExtension(PStrings.interactable);

                    if (interactable != null)
                    {
                        float   sqrDistanceThreshold = 2.0f;
                        Vector3 interactablePosition = new Vector3(extensible.gameObject.transform.position.x, 0, extensible.gameObject.transform.position.z);
                        Vector3 interactorPosition   = new Vector3(rigidbody.position.x, 0, rigidbody.position.z);
                        if ((interactablePosition - interactorPosition).sqrMagnitude <= (sqrDistanceThreshold * sqrDistanceThreshold))
                        {
                            interactable.Switch();
                        }
                    }
                }
            }
        }
    }
Esempio n. 12
0
    public override void Initialize(int ownerUniqueID)
    {
        this.ownerUniqueID = ownerUniqueID;
        identifier         = PStrings.light;

        ExtensibleData owner = GridData.GetExtensible(ownerUniqueID);

        Mode = owner.lightMode;

        lightComponent = GridData.GetExtensible(ownerUniqueID).gameObject.GetComponentInChildren <Light>();
        localZero      = lightComponent.transform.localPosition;

        nextCycleTime   = -1f;
        msBetweenCycles = 66.6666f;

        intensityMinimum = 2f;
        intensityMaximum = 2f;

        pulseSpeed  = 2f;
        strobeSpeed = 0f;
        flickerBias = 0.1f;
    }
    public override void Initialize(int ownerUniqueID)
    {
        this.ownerUniqueID = ownerUniqueID;
        identifier         = PStrings.visualEffects;

        nextCycleTime = -1f;

        ExtensibleData owner = GridData.GetExtensible(ownerUniqueID);

        if (owner != null && owner.gameObject != null)
        {
            modelT = owner.gameObject.transform.GetChild(0);
        }

        localEulerZero    = (modelT != null) ? modelT.localEulerAngles : Vector3.zero;
        localPositionZero = (modelT != null) ? modelT.localPosition : Vector3.zero;

        Bobbing  = true;
        Spinning = true;

        bobbingSpeed  = 0.1f;
        spinningSpeed = 0.25f;
    }
Esempio n. 14
0
        protected internal override void Embed(ExtensibleData subject)
        {
            var value = (Subject)subject;

            this._extracted = this._extracted == null ? value._extracted : this._extracted;

            if (value._identifiers != null)
            {
                this._identifiers = this._identifiers == null ? new List <Identifier>() : this._identifiers;
                this._identifiers.AddRange(value._identifiers);
            }
            if (value._media != null)
            {
                this._media = this._media == null ? new List <SourceReference>() : this._media;
                this._media.AddRange(value._media);
            }
            if (value._evidence != null)
            {
                this._evidence = this._evidence == null ? new List <EvidenceReference>() : this._evidence;
                this._evidence.AddRange(value._evidence);
            }

            base.Embed(subject);
        }
Esempio n. 15
0
 protected internal override void Embed(ExtensibleData conclusion)
 {
     var value = (Conclusion)conclusion;
     this._lang = this._lang == null ? value._lang : this._lang;
     this._confidence = this._confidence == null ? value._confidence : this._confidence;
     this._attribution = this._attribution == null ? value._attribution : this._attribution;
     this._analysis = this._analysis == null ? value._analysis : this._analysis;
     if (value._notes != null)
     {
         this._notes = this._notes == null ? new List<Note>() : this._notes;
         this._notes.AddRange(value._notes);
     }
     if (value._sources != null)
     {
         this._sources = this._sources == null ? new List<SourceReference>() : this._sources;
         this._sources.AddRange(value._sources);
     }
     base.Embed(conclusion);
 }
 internal void EmbedInt(ExtensibleData relationship)
 {
     this.Embed(relationship);
 }
        protected override void Embed(ExtensibleData relationship)
        {
            ChildAndParentsRelationship value = relationship as ChildAndParentsRelationship;

            if (value != null)
            {
                if (value.MotherFacts != null)
                {
                    this.MotherFacts = this.MotherFacts == null ? new List<Fact>() : this.MotherFacts;
                    this.MotherFacts.AddRange(value.MotherFacts);
                }
                if (value.FatherFacts != null)
                {
                    this.FatherFacts = this.FatherFacts == null ? new List<Fact>() : this.FatherFacts;
                    this.FatherFacts.AddRange(value.FatherFacts);
                }
            }

            base.Embed(relationship);
        }
Esempio n. 18
0
 internal void EmbedInt(ExtensibleData value)
 {
     this.Embed(value);
 }
 protected internal override void Embed(ExtensibleData data)
 {
     var value = (DisplayProperties)data;
     this._name = this._name == null ? value._name : this._name;
     this._gender = this._gender == null ? value._gender : this._gender;
     this._lifespan = this._lifespan == null ? value._lifespan : this._lifespan;
     this._birthDate = this._birthDate == null ? value._birthDate : this._birthDate;
     this._birthPlace = this._birthPlace == null ? value._birthPlace : this._birthPlace;
     this._deathDate = this._deathDate == null ? value._deathDate : this._deathDate;
     this._deathPlace = this._deathPlace == null ? value._deathPlace : this._deathPlace;
     this._marriageDate = this._marriageDate == null ? value._marriageDate : this._marriageDate;
     this._marriagePlace = this._marriagePlace == null ? value._marriagePlace : this._marriagePlace;
     this._ascendancyNumber = this._ascendancyNumber == null ? value._ascendancyNumber : this._ascendancyNumber;
     this._descendancyNumber = this._descendancyNumber == null ? value._descendancyNumber : this._descendancyNumber;
     base.Embed(data);
 }
Esempio n. 20
0
 internal void EmbedInt(ExtensibleData value)
 {
     this.Embed(value);
 }
Esempio n. 21
0
        protected internal override void Embed(ExtensibleData subject)
        {
            var value = (Subject)subject;
            this._extracted = this._extracted == null ? value._extracted : this._extracted;

            if (value._identifiers != null)
            {
                this._identifiers = this._identifiers == null ? new List<Identifier>() : this._identifiers;
                this._identifiers.AddRange(value._identifiers);
            }
            if (value._media != null)
            {
                this._media = this._media == null ? new List<SourceReference>() : this._media;
                this._media.AddRange(value._media);
            }
            if (value._evidence != null)
            {
                this._evidence = this._evidence == null ? new List<EvidenceReference>() : this._evidence;
                this._evidence.AddRange(value._evidence);
            }

            base.Embed(subject);
        }
Esempio n. 22
0
        protected override void Embed(ExtensibleData value)
        {
            Discussion discussion = value as Discussion;
            List<Comment> comments = discussion.Comments;
            if (comments != null)
            {
                foreach (Comment comment in comments)
                {
                    bool found = false;
                    if (comment.Id != null)
                    {
                        if (Comments != null)
                        {
                            foreach (Comment target in Comments)
                            {
                                if (comment.Id.Equals(target.Id))
                                {
                                    target.EmbedInt(comment);
                                    found = true;
                                    break;
                                }
                            }
                        }
                    }

                    if (!found)
                    {
                        AddComment(comment);
                    }
                }
            }

            base.Embed(discussion);
        }
 internal void EmbedInt(ExtensibleData relationship)
 {
     this.Embed(relationship);
 }