コード例 #1
0
ファイル: ExecutionAdapter.cs プロジェクト: voidALPHA/cgc_viz
        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);
        }
コード例 #3
0
        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);
        }