Пример #1
0
    // get a copy of the top value from the specified Card
    // the Card still keeps the value
    IEnumerator COPY_FROM()
    {
        // get card reference
        CurrentArg = current.Arg;
        CardLogic card = cardContainer.GetCard((int)CurrentArg);

        // insert a pause if grabbing consecutive inputs so the action is visible to the player
        if (previous != null && previous.Instruction == OpCode.COPY_FROM)
        {
            yield return(new WaitForSeconds(InstructionDelay));
        }

        // Computron gets a copy of the top item from the specified Card
        CurrentValue = (int)card.CopyFrom();
        ShowDataCube(CurrentValue);

        currentState = ACTOR_STATE.REPORTING;
    }
Пример #2
0
    // if current value is less than value at destination, jump; else, continue sequential execution
    IEnumerator JUMP_IF_LESS()
    {
        // grab card reference
        CurrentArg = current.Arg;
        CardLogic card = cardContainer.GetCard((int)CurrentArg);

        // Computron gets a copy of the top item from the specified Card
        SecondValue = card.CopyFrom();

        // ensure neither value is null
        if (CurrentValue == null || SecondValue == null)
        {
            error        = true;
            currentState = ACTOR_STATE.REPORTING;
            yield return(StartCoroutine(currentState.ToString()));
        }

        yield return(new WaitForSeconds(InstructionDelay));

        conditionalResult = (CurrentValue < SecondValue);

        // show the two values being compared
        DisplayMessage(CurrentValue.ToString());
        yield return(new WaitForSeconds(InstructionDelay));

        DisplayMessage(DisplayText.text + " < ");
        yield return(new WaitForSeconds(InstructionDelay));

        DisplayMessage(DisplayText.text + SecondValue.ToString());
        yield return(new WaitForSeconds(InstructionDelay));

        DisplayMessage(DisplayText.text + " ?");
        yield return(new WaitForSeconds(InstructionDelay));

        DisplayMessage(conditionalResult.ToString());
        yield return(new WaitForSeconds(InstructionDelay));

        ShowDataCube(CurrentValue);
        HideTextBox();

        currentState = ACTOR_STATE.REPORTING;
    }