Exemple #1
0
    /// <summary>
    /// Change le joueur actif
    /// </summary>
    public void ChangeActivePlayer()
    {
        joueurs[joueurActif].MakeAllUnitsUnavailable();

        if (joueurActif == joueurs.Count - 1)
        {
            joueurActif = 0;
        }
        else
        {
            joueurActif++;
        }

        joueurs[joueurActif].MakeAllUnitsAvailable();
        joueurs[joueurActif].AjouterCredits(joueurs[joueurActif].EstimatedEarnings());
        timer = maxTime;

        phaseActive = phases.Deploiement;

        if (joueurs[joueurActif].Humain)
        {
            button.transform.GetChild(0).GetComponent <Text>().text = "Phase suivante";
            button.gameObject.SetActive(true);
            guiManager.CloseDialog(guiManager.waitingPanel);
        }
        else
        {
            button.gameObject.SetActive(false);
            IA joueurIA = joueurs[joueurActif] as IA;
            guiManager.OpenDialog(guiManager.waitingPanel);

            StartCoroutine(joueurIA.IAPlay());
        }
    }
Exemple #2
0
    void Update()
    {
        if (currentPhase == phases.PlayerPhase)
        {
            canMoveOrbs = true;
            for (int y = 0; y < 4; y++)
            {
                for (int x = 0; x < 4; x++)
                {
                    setOrbArray(x, y); //reset the orb array to be correct
                    if (orbMoved == true)
                    {
                        currentPhase = phases.OrbExecutePhase;
                    }
                }
            }
        }

        if (currentPhase == phases.OrbExecutePhase)
        {
            canMoveOrbs = false;
            for (int y = 0; y < 4; y++)
            {
                for (int x = 0; x < 4; x++)
                {
                    isThereAMatch(x, y);
                    deleteOrbs(x, y);
                }
            }
        }

        if (currentPhase == phases.EnemyPhase)
        {
        }
    }
Exemple #3
0
 public override void HighSpeedCycle()
 {
     if (Phase == phases.Read)
     {
         cpu.Memory[CurrentAddressRegister] = DataWordBuffer;
         DataWordBuffer = 0;
         CurrentAddressRegister++;
         if (CurrentAddressRegister == FinalAddressRegister)
         {
             StateRegister      |= STAT_CA_EQ_FA;
             RecordComplete      = true;
             RecordCompleteTimer = 100;
             if (Irq > 0)
             {
                 cpu.requestBreak(Irq - 1);
             }
             Next  = 260;
             Phase = phases.EORRead;
         }
     }
     if (Phase == phases.Write)
     {
         DataWordBuffer = cpu.Memory[CurrentAddressRegister];
     }
     if (Phase == phases.Comp)
     {
         if (DataWordBuffer != cpu.Memory[CurrentAddressRegister])
         {
         }
     }
 }
Exemple #4
0
 protected void Start()
 {
     if (commandRegister == CMD_READ_EVEN || commandRegister == CMD_READ_ODD)
     {
         Phase = phases.Read;
         transports[TapeUnitRegister].ReadMode();
         Next       = 65;
         wordShift  = 12;
         ValidStart = false;
     }
     if (commandRegister == CMD_COMP_EVEN || commandRegister == CMD_COMP_ODD)
     {
         Phase = phases.Comp;
         transports[TapeUnitRegister].ReadMode();
         Next      = 65;
         wordShift = 12;
     }
     if (commandRegister == CMD_WRITE_EVEN || commandRegister == CMD_WRITE_ODD)
     {
         Phase            = phases.Write;
         HighSpeedRequest = 5;
         transports[TapeUnitRegister].WriteMode();
         Next      = 65;
         wordShift = 12;
     }
 }
Exemple #5
0
 protected void Write()
 {
     WriteBuffer = AddParity((byte)((DataWordBuffer >> wordShift) & 0x3f));
     transports[TapeUnitRegister].Write(WriteBuffer);
     wordShift -= 6;
     if (wordShift < 0)
     {
         CurrentAddressRegister++;
         if (CurrentAddressRegister == FinalAddressRegister)
         {
             StateRegister      |= STAT_CA_EQ_FA;
             RecordComplete      = true;
             RecordCompleteTimer = 100;
             if (Irq > 0)
             {
                 cpu.requestBreak(Irq - 1);
             }
             Next  = 260;
             Phase = phases.EORWrite;
         }
         else
         {
             wordShift        = 12;
             HighSpeedRequest = 5;
             Next             = 65;
         }
     }
     else
     {
         Next = 65;
     }
 }
    void EndMovement()
    {
        if (!background)
        {
            background = FindObjectOfType <backgroundManager>();
        }
        if (background.currentScroll)
        {
            background.currentScroll.ScrollAll(false);
        }

        phase = phases.None;
        SetMovementStartAndSpeed(phase);

        textDisplay.gameObject.SetActive(false);
        textBackground.SetActive(false);

        if (button.boss)
        {
            boss.EnableBossSpecific(true);
        }


        calculator.AbleCalculator(true);
    }
Exemple #7
0
    // Use this for initialization
    void Start()
    {
        assignGoals();
        updateScore();
        currentPhase = phases.ROUNDSTART;

        // place la balle a 90 et 100 dans les y et 0 a 30 dans les X
    }
Exemple #8
0
 public void specify_phase(phases phase)
 {
     CoolPropPINVOKE.AbstractState_specify_phase(swigCPtr, (int)phase);
     if (CoolPropPINVOKE.SWIGPendingException.Pending)
     {
         throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #9
0
 protected void EorWrite()
 {
     if (commandRegister == CMD_WRITE_EVEN || commandRegister == CMD_WRITE_ODD)
     {
         transports[TapeUnitRegister].WriteEof();
     }
     Phase = phases.Stop;
     Next  = 3000;
 }
Exemple #10
0
    public static phases get_phase_index(string param_name)
    {
        phases ret = (phases)CoolPropPINVOKE.get_phase_index(param_name);

        if (CoolPropPINVOKE.SWIGPendingException.Pending)
        {
            throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Exemple #11
0
    public phases phase()
    {
        phases ret = (phases)CoolPropPINVOKE.AbstractState_phase(swigCPtr);

        if (CoolPropPINVOKE.SWIGPendingException.Pending)
        {
            throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Exemple #12
0
    public static string phase_lookup_string(phases Phase)
    {
        string ret = CoolPropPINVOKE.phase_lookup_string((int)Phase);

        if (CoolPropPINVOKE.SWIGPendingException.Pending)
        {
            throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Exemple #13
0
 public Type52TapeControl(Cpu c, int a) : base(c, 8)
 {
     Address          = a;
     TapeUnitRegister = -1;
     Irq                 = 2 + a;
     RecordComplete      = true;
     HighSpeedRequest    = 0;
     StateRegister       = 0;
     RecordCompleteTimer = 0;
     Phase               = phases.Idle;
 }
Exemple #14
0
    void Start()
    {
        currentPhase = phases.StartingPhase;

        for (int y = 0; y < 4; y++)
        {
            for (int x = 0; x < 4; x++)
            {
                gridArray[x, y]      = Instantiate(cell, new Vector3(gridPos.position.x + (x * distributeIt), gridPos.position.y - (y * distributeIt), 0), transform.rotation);
                gridArray[x, y].name = "cell " + x + "-" + y;
            }
        }
        currentPhase = phases.PlayerPhase;
    }
    //Phase changer
    void SwitchPhase()
    {
        switch (currentPhase)
        {
        case phases.Intro:
            currentPhase = phases.Standby;
            StartCoroutine("Coordinator");
            break;

        case phases.Standby:
            currentPhase = phases.BossStart;
            StartCoroutine("Coordinator");
            break;
        }
    }
    public override void buttonUsed(phases phase)
    {
        p_manager = GameObject.Find("MonsterManager").GetComponent <MonsterManager>();


        if (!storyManager)
        {
            storyManager = FindObjectOfType <StoryManager>();
        }

        storyManager.StartTransition(this, phase);

        boss = true;
        p_manager.StartLevel(this);
    }
Exemple #17
0
    //Call the quizManager to start a quiz using this button as the basis.
    public virtual void buttonUsed(phases a_phase)
    {
        setStats();

        p_manager = GameObject.Find("MonsterManager").GetComponent <MonsterManager>();

        if (!storyManager)
        {
            storyManager = FindObjectOfType <StoryManager>();
        }

        storyManager.StartTransition(this, a_phase);

        boss = false;


        p_manager.StartLevel(this);
    }
    // Update is called once per frame
    void Update()
    {
        if (currentPhase == 0)
        {
            var distance = Vector3.Distance(transform.position, PlayerController.instance.transform.position);
            if (distance <= battleStartRange)
            {
                goToNextPhase();
            }
        }

        if (GameManager.instace.respawning)
        {
            currentPhase = phases.intro;
            anim.animationPhase(0);
            gameObject.SetActive(false);
            robotActivetor.SetActive(true);
            entrace.SetActive(true);
            GameManager.instace.respawning = false;
        }
    }
Exemple #19
0
 protected void Comp()
 {
     if (ReadBuffer == 0)
     {
         eorBytes++;
     }
     if (Phase == phases.Read)
     {
         DataWordBuffer |= (UInt32)((ReadBuffer & 0x3f) << wordShift);
         Next            = 65;
         wordShift      -= 6;
         if (wordShift < 0)
         {
             CurrentAddressRegister++;
             if (CurrentAddressRegister == FinalAddressRegister)
             {
                 StateRegister      |= STAT_CA_EQ_FA;
                 RecordComplete      = true;
                 RecordCompleteTimer = 100;
                 if (Irq > 0)
                 {
                     cpu.requestBreak(Irq - 1);
                 }
                 Next  = 260;
                 Phase = phases.EORRead;
             }
             else
             {
                 wordShift        = 12;
                 HighSpeedRequest = 5;
                 Next             = 65;
             }
         }
         else
         {
             Next = 65;
         }
     }
 }
Exemple #20
0
    void Update()
    {
        if (currentPhase == phases.ROUNDSTART)
        {
            _currentBalls = createBall();
            _pinePLaced   = 0;
            currentPhase  = phases.PLACING;
        }

        if (currentPhase == phases.PLACING)
        {
            if (pick.Pine == null && _pinePLaced >= 4)
            {
                currentPhase = phases.ACTION;
            }
            else if (pick.Pine == null)
            {
                CreatePine(_pinePLaced % 2);
                _pinePLaced++;
            }
        }

        if (currentPhase == phases.ACTION && _currentBalls.Count > 0)
        {
            foreach (GameObject ball in _currentBalls)
            {
                ball.GetComponent <Rigidbody2D>().gravityScale = 1;
                ball.GetComponent <Rigidbody2D>().constraints  = RigidbodyConstraints2D.None;
            }
        }

        if (_currentBalls.Count == 0)
        {
            currentPhase = phases.ROUNDSTART;
        }

        updateScore();
    }
    internal void StartTransition(QuizButton a_button, phases a_startingPhase)
    {
        button = a_button;

        if (a_startingPhase == phases.None)
        {
            EndMovement();
            return;
        }

        textBackground.SetActive(true);
        textDisplay.gameObject.SetActive(true);

        timer = 0;

        calculator.AbleCalculator(false);

        previousLevelWords = a_button.previousLevelString;
        previousTime       = a_button.previousTime;

        nextLevelWords = a_button.nextLevelString;
        nextime        = a_button.nextime;

        enemyWords = a_button.enemyString;
        enemyTime  = a_button.enemyTime;
        SetMovementStartAndSpeed(a_startingPhase);

        phase = a_startingPhase;


        if (FindObjectOfType <equipmentList>().skipping)
        {
            enemyTime    = 0;
            previousTime = 0;
            nextime      = 0;
            healthbars.skipRefill();
        }
    }
    // Public methods ------------------

    public void FirstPhaseDo(bool up)
    {
        if (FirstPhaseDone)
        {
            return;
        }

        FirstPhaseDone = true;
        phaseStartDT   = DateTime.Now;

        if (encoderRhythm.RepsOrPhases)
        {
            currentPhase = getNextPhase(phases.REPETITION);
        }
        else if (up)
        {
            currentPhase = getNextPhase(phases.CON);
        }
        else
        {
            currentPhase = getNextPhase(phases.ECC);
        }
    }
    //useful for fraction of the repetition and the rest time
    public void CalculateFractionsAndText()
    {
        //double fraction = 0;
        TimeSpan span         = DateTime.Now - phaseStartDT;
        double   phaseSeconds = span.TotalSeconds;

        //check if should end phase
        if (shouldEndPhase(phaseSeconds))
        {
            phaseStartDT = DateTime.Now;
            phaseSeconds = 0;

            //check if should end rep
            if (endPhaseShouldEndRep())
            {
                nreps++;
            }

            //change to next phase
            currentPhase = getNextPhase(currentPhase);
        }

        setFractionAndText(phaseSeconds);
    }
    void CheckTransitionEnd()
    {
        switch (phase)
        {
        case phases.previous:
            if (timer > previousTime)
            {
                phase = phases.next;
                timer = 0;
                SetMovementStartAndSpeed(phase);
            }
            break;

        case phases.next:
            if (timer > nextime)
            {
                phase            = phases.enemy;
                timer            = 0;
                textDisplay.text = enemyWords;
                SetMovementStartAndSpeed(phase);
                healthbars.wait = false;
            }
            break;

        case phases.enemy:
            if (timer > enemyTime)
            {
                healthbars.wait = false;
                EndMovement();
            }
            break;

        default:
            break;
        }
    }
 public void specify_phase(phases phase) {
   CoolPropPINVOKE.AbstractState_specify_phase(swigCPtr, (int)phase);
   if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve();
 }
Exemple #26
0
 void BossDead()
 {
     phase = phases.perfect_freeze_2;
     transform.position = new Vector2(-2, 0);
 }
Exemple #27
0
 public static void setCurrentPhase(phases p)
 {
     phase = p;
 }
Exemple #28
0
 void BossDead()
 {
     phase = phases.dos;
     transform.position = new Vector2(-2, 0);
 }
Exemple #29
0
    /// <summary>
    /// Active le changement de phase/tour
    /// </summary>
    public void PasserButton()
    {
        if (!GetComponent <GUIController>().dialogOpened) // S'il n'y a pas de fenêtre de dialogue d'ouverte
        {
            if (phaseActive == phases.Deploiement)
            {
                List <Unite> .Enumerator unitsEnum = joueurs[joueurActif].Unites.GetEnumerator();
                bool canPass = true;

                while (canPass && unitsEnum.MoveNext())
                {
                    if (unitsEnum.Current is Terrestre)
                    {
                        Terrestre unit = unitsEnum.Current as Terrestre;

                        if (unit.territoire == null)
                        {
                            canPass = false;
                        }
                    }
                    else if (unitsEnum.Current is Aerienne)
                    {
                        Aerienne unit = unitsEnum.Current as Aerienne;

                        if (unit.territoire == null)
                        {
                            canPass = false;
                        }
                    }
                    else
                    {
                        Maritime unit = unitsEnum.Current as Maritime;

                        if (unit.route == null)
                        {
                            canPass = false;
                        }
                    }
                }

                if (canPass)
                {
                    phaseActive = phases.Attaque;

                    if (!joueurs[joueurActif].Humain)
                    {
                        IAEasy joueurIA = joueurs[joueurActif] as IAEasy;

                        joueurIA.IAPlay();
                    }
                }
                else
                {
                    InvalidAction("Vous ne pouvez passer votre tour sans déployer toutes les unités nouvellement achetées.");
                }
            }
            else if (phaseActive == phases.Attaque)
            {
                phaseActive = phases.Mouvement;

                if (!joueurs[joueurActif].Humain)
                {
                    IAEasy joueurIA = joueurs[joueurActif] as IAEasy;

                    joueurIA.IAPlay();
                }
                else
                {
                    button.transform.GetChild(0).GetComponent <Text>().text = "Fin du tour";
                }
            }
            else if (phaseActive == phases.Mouvement)
            {
                ChangeActivePlayer();
            }
        }
    }
    void SetMovementStartAndSpeed(phases position)
    {
        if (!background)
        {
            background = FindObjectOfType <backgroundManager>();
        }

        if (position == phases.enemy || position == phases.None)
        {
            if (background.currentScroll)
            {
                background.currentScroll.ScrollAll(false);
            }

            objectSpot = 0;
            movingObject.transform.localPosition = new Vector3(0, 0, 0);
            movementIncrement = 0;
            monsterSpot.gameObject.SetActive(true);

            calculatorParent.SetActive(true);
            //transitionManager.TransitionContainers(TransitioningObjects.SwapToCalculator);
        }
        if (position == phases.None)
        {
            foreach (Button item in calcButtons)
            {
                item.interactable = true;
            }
        }
        else
        {
            foreach (Button item in calcButtons)
            {
                item.interactable = false;
            }
        }

        if (position == phases.previous)
        {
            if (background.currentScroll)
            {
                background.currentScroll.ScrollAll(true);
            }

            if (previousTime == 0)
            {
                movementIncrement = 0;
                return;
            }
            monsterSpot.gameObject.SetActive(false);

            objectSpot = 0;
            movingObject.transform.localPosition = new Vector3(objectSpot, 0, 0);
            movementIncrement = -(1200 / previousTime);
            textDisplay.text  = previousLevelWords;

            calculatorParent.SetActive(false);
        }
        else if (position == phases.next)
        {
            if (background.currentScroll)
            {
                background.currentScroll.ScrollAll(true);
            }

            if (nextime == 0)
            {
                movementIncrement = 0;
                return;
            }

            monsterSpot.gameObject.SetActive(true);

            objectSpot = 1200;
            movingObject.transform.localPosition = new Vector3(1200, 0, 0);
            movementIncrement = -(1200 / nextime);
            textDisplay.text  = nextLevelWords;

            calculatorParent.SetActive(false);
        }
    }
 // Use this for initialization
 void Start()
 {
     phase = phases.None;
     textDisplay.gameObject.SetActive(false);
     textBackground.SetActive(false);
 }