Exemplo n.º 1
0
    private string generateRequirementsText(Recipe recipe)
    {
        List <int> requirements = recipe.getRequireTech();

        string text = "";
        bool   flag = false;

        foreach (int id in requirements)
        {
            if (flag)
            {
                text += "\n";
            }
            else
            {
                flag = true;
            }

            if (rm.checkTechDone(id))
            {
                text += TechnologyDatabase.findNameById(id);
            }
            else
            {
                text += highlight(TechnologyDatabase.findNameById(id));
            }
        }

        return(text);
    }
Exemplo n.º 2
0
    // harvest from seed
    public void ITEM_Seed(List <int> param)
    {
        // int day = param[0];
        int productId    = param[1];
        int productCount = param[2];
        int seedId       = param[3];
        int seedCount    = param[4];

        player.addItem(productId, productCount);

        if (rm.checkTechDone(TechnologyDatabase.findIdByName("비료")))
        {
            seedCount += 1;
        }

        player.addItem(seedId, seedCount);
    }
Exemplo n.º 3
0
    public void init()
    {
        gm = GameManager.gm;

        lockedList    = new List <Technology>(TechnologyDatabase.load());
        availableList = new List <Technology>();
        doneList      = new List <Technology>();

        // move basic technologies to available
        for (int i = lockedList.Count - 1; i >= 0; i--)
        {
            if (lockedList[i].Satisfied())
            {
                availableList.Add(lockedList[i]);
                lockedList.RemoveAt(i);
            }
        }
    }
Exemplo n.º 4
0
 public Requirement(int id, bool done)
 {
     this.tech = TechnologyDatabase.findTechnology(id);
     this.done = done;
 }
Exemplo n.º 5
0
 public Requirement(int id)
 {
     this.tech = TechnologyDatabase.findTechnology(id);
     this.done = false;
 }
Exemplo n.º 6
0
    private void initGame()
    {
        /*
         *  Initializing player
         *
         */
        player = new Player(100, 1000, 0, 100f);

        /*
         * Initializing Databases
         *
         */
        itemText   = Resources.Load("Data/Item") as TextAsset;
        recipeText = Resources.Load("Data/Recipe") as TextAsset;
        techText   = Resources.Load("Data/Technology") as TextAsset;

        ItemDatabase.init(itemText);
        RecipeDatabase.init(recipeText);
        TechnologyDatabase.init(techText);
        FieldDropDatabase.init();

        /*
         * Other Managers Initializing
         *
         * **CAUTION**
         * You must initialize managers after initializing databases, player
         * because initializing managers contain loading object, data from database, player
         * also, order of initializing managers also matters
         */

        researchManager = GetComponent <ResearchManager>();
        researchManager.init();

        // craftManager references researchManager
        craftManager = GetComponent <CraftManager>();
        craftManager.init();

        //
        boardManager = GetComponent <BoardManager>();
        boardManager.init();
        soundManager = GetComponentInChildren <SoundManager>();

        /*
         * Effect Processor Initializing
         * **CAUTION**
         * You must initialize this after all other initializing done
         */
        effectProcessor = new EffectProcessor();
        effectProcessor.init();

        ///*
        // * get Inventory
        // */

        //inventory = transform.Find("Canvas/InventoryPanel").gameObject;

        // default scene
        scene = SCENES.BASE;

        // game play variables initialize
        day            = 1;
        exploreChance  = true;
        moveChance     = true;
        researchChance = true;

        // start game
        SceneManager.LoadScene(scene);
    }