Exemplo n.º 1
0
    private void ResetTurnFunction()
    {
        ResetSimulation();
        OrganSettlementManager MyMan      = gameObject.GetComponent <OrganSettlementManager>();
        List <GameObject>      Obj2Unlist = new List <GameObject>();

        foreach (GameObject orgObj in MyMan.GetInstantiatedOrgans())
        {
            Organ org = orgObj.GetComponent <Organ>();
            org.OnResetTurn();
            if (org.GetBuildTurn() == roundCount)
            {
                Refund(org.resourcesType);
                LineDrawer.ClearOrganRelations(org.GetBuildTurn());
                Obj2Unlist.Add(orgObj);
                Destroy(orgObj);
            }
            else
            {
                org.OnSimulateReward();
            }
        }
        foreach (GameObject orgObj in Obj2Unlist)
        {
            MyMan.GetInstantiatedOrgans().Remove(orgObj);
        }
        MyMan.OnResetTurn();
    }
Exemplo n.º 2
0
    public bool GoToNextTurn()
    {
        bool res = LaunchAttack();

        if (res)
        {
            LaunchReward();
            LaunchPreparation();
            OrganSettlementManager MyMan      = gameObject.GetComponent <OrganSettlementManager>();
            List <GameObject>      Obj2Unlist = new List <GameObject>();
            foreach (GameObject orgObj in MyMan.GetInstantiatedOrgans())
            {
                Organ org = orgObj.GetComponent <Organ>();
                org.OnGoToNextTurn();
            }
            foreach (MainOrgan mOrg in organContainer.GetComponentsInChildren <MainOrgan>())
            {
                mOrg.OnGoToNextTurn();
            }
            UpdateSimulation();
            DebugDisplay();
            Debug.Log("tour " + roundCount);
        }
        defOnTurn = 0;
        return(res);
    }
Exemplo n.º 3
0
    public void UpdateSimulation()
    {
        ResetSimulation();
        OrganSettlementManager MyMan = gameObject.GetComponent <OrganSettlementManager>();

        foreach (GameObject orgObj in MyMan.GetInstantiatedOrgans())
        {
            Organ org = orgObj.GetComponent <Organ>();
            org.OnSimulateReward();
        }
    }