예제 #1
0
        private static void SetAnnotationOnInstructionMutable(MutableObject instruction, AnnotationElement annotation, Dictionary <int, string> comms)
        {
            if (annotation.ByteString.StartsWith("Receive") || annotation.ByteString.StartsWith("Transmit"))
            {
                comms.Add((int)annotation.Header.InstructionCount, annotation.ByteString);
            }

            if (instruction.ContainsKey("AnnotationText") || instruction.ContainsKey("Annotation Event Type"))
            {
                Debug.LogWarningFormat("Overwriting the annotation on an instruction (index {0})...!", annotation.Header.InstructionCount);
            }

            instruction["Annotation Text"]       = annotation.ByteString;
            instruction["Annotation Event Type"] = annotation.EventType;
            instruction["Annotated"]             = true;
        }
예제 #2
0
        protected override MutableObject Mutate(MutableObject mutable)
        {
            if (!Schema.ContainsKey(Key))
            {
                Schema.Add(Key, "Pi");
            }

            if (!mutable.ContainsKey(Key))
            {
                mutable.Add(Key, Schema[Key]);
            }

            return(mutable);
        }
        protected override MutableObject Mutate(MutableObject mutable)
        {
            if (!IncludeRandomFloat)
            {
                if (mutable.ContainsKey("RandomFloat"))
                {
                    mutable.Remove("RandomFloat");
                }
            }
            else
            {
                if (!mutable.ContainsKey("RandomFloat"))
                {
                    mutable.Add("RandomFloat", Random.Range(0.0f, 1.0f));
                }
                else
                {
                    mutable["RandomFloat"] = Random.Range(0.0f, 1.0f);
                }
            }

            return(mutable);
        }