Beispiel #1
0
 public void Init()
 {
     identifier = Points.GetComponent <TargetIdentifier> ();
     if (!identifier)
     {
         identifier = Points.gameObject.AddComponent <TargetIdentifier> ();
     }
 }
Beispiel #2
0
 public PlanetView()
 {
     this.mapManipulator   = null;
     this.scaffolding      = new Scaffolding();
     this.targetIdentifier = new TargetIdentifier();
     this.heroIdentifier   = new HeroIdentifier();
     this.spawnProtection  = new SpawnProtectionView();
     this.Reset();
 }
Beispiel #3
0
        protected override void OnEstablishBinding()
        {
            SourceIdentifier.AssertValid($"{gameObject.name}: No source callback found.");
            TargetIdentifier.AssertValid($"{gameObject.name}: No target event found.");

            // Resolve an actual PropertyInfo from the serialized index
            _sourceCallback = SourceIdentifier.ResolveFrom(Source);
            _targetEvent    = TargetIdentifier.ResolveFrom(Target);

            var destructor = UiEventLookup.RegisterForEvent(Target, _targetEvent, _sourceCallback, OnTargetChanged);

            AddDestructor(destructor);
        }
        public override void RestoreTargetFromIdentifier(MyProject project)
        {
            if (TargetIdentifier != null)
            {
                string[] split = TargetIdentifier.Split('#');
                if (split.Length == 2)
                {
                    MyWorkingNode node = (MyWorkingNode)project.GetNodeById(int.Parse(split[0]));

                    if (node != null)
                    {
                        Target = MyMemoryManager.Instance.GetMemoryBlockByName(node, split[1]);
                    }
                }
            }
        }
Beispiel #5
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            ((Fhir.R4.Models.BackboneElement) this).SerializeJson(writer, options, false);

            if (!string.IsNullOrEmpty(Code))
            {
                writer.WriteString("code", (string)Code !);
            }

            if (_Code != null)
            {
                writer.WritePropertyName("_code");
                _Code.SerializeJson(writer, options);
            }

            if (TargetIdentifier != null)
            {
                writer.WritePropertyName("targetIdentifier");
                TargetIdentifier.SerializeJson(writer, options);
            }

            if (TargetReference != null)
            {
                writer.WritePropertyName("targetReference");
                TargetReference.SerializeJson(writer, options);
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }