Ejemplo n.º 1
0
    // Doesn't return a reference
    public List <Job> GetJobsAvaliableData(ActorData data)
    {
        List <Job> temp = new List <Job>();

        List <string> jkeys = raceDB.GetCopy(data.race).GetAllPossibleJobs();

        foreach (string jkey in jkeys)
        {
            temp.Add(JobDB.GetCopy(jkey));
        }

        return(temp);
    }
Ejemplo n.º 2
0
    public Item GetitemCopy(string key)
    {
        if (key == "")
        {
            Item t = new Item("");
            t.Name = "Empty";
            t.DisappearsInventory = true;
            t.equippEffect        = new EquippableItem();

            return(t);
        }

        return(itemDB.GetCopy(key));
    }
Ejemplo n.º 3
0
    void PopulateItemList()
    {
        ClearButtons();

        SavedDatabase <Item> itemdb = Globals.campaign.GetAllItems();



        foreach (string key in currShop.AvaliableItemKeys)
        {
            Item i = itemdb.GetCopy(key);
            CreateItemButton(i);
        }

        ItemContainer.AdjustContentLength();
        ItemContainer.buttonConatiner.SelectFirst();
    }
Ejemplo n.º 4
0
    private void PrintBoard()
    {
        GameObject go = Resources.Load <GameObject>(FilePath.TilePrefab);
        SavedDatabase <TileTypes> tiles = Globals.campaign.GetTileData().Tiles;

        int sizeX = baseMap.sizeX;
        int sizeY = baseMap.sizeY;

        pathfinding = new Pathfinding(sizeX, sizeY);

        for (int x = 0; x < sizeX; x++)
        {
            for (int y = 0; y < sizeY; y++)
            {
                // Heres where we'll probably adjust the height map stuff
                GameObject temp = Instantiate(go, transform);
                TileData   data = new TileData(x, y);

                // Creating new tile types
                // We have to rework how maps are saved
                TileTypes types = tiles.GetCopy(baseMap.tileBoard[x, y]);

                Tile newTile = temp.GetComponent <Tile>();
                temp.GetComponent <Tile>().InitTile(data, types);

                pathfinding.AddTile(newTile, x, y);

                temp.transform.position = Globals.GridToWorld(x, y);

                temp.GetComponent <SpriteRenderer>().sprite = atlas.GetSprite(types.spriteFilePath);
                temp.name = x + " " + y;
            }
        }

        pathfinding.PopulateNieghbors();
    }
Ejemplo n.º 5
0
    void GenerateBoard()
    {
        GameObject go = Resources.Load <GameObject>(FilePath.TilePrefab);
        SavedDatabase <TileTypes> tileDB = Globals.campaign.GetTileData().Tiles;

        int sizeX = currMap.sizeX;
        int sizeY = currMap.sizeY;

        pathfinding = new Pathfinding(sizeX, sizeY);
        EffectBoard = new TileEffectSprite[sizeX, sizeY];

        for (int x = 0; x < sizeX; x++)
        {
            for (int y = 0; y < sizeY; y++)
            {
                //Heres where we'll probably adjust the height map stuff

                GameObject temp = Instantiate(go, transform);
                TileData   data = new TileData(x, y);

                // maybe we should create a new board that will just replace the board in the current
                // map?
                TileTypes types = tileDB.GetCopy(currMap.tileBoard[x, y]);
                //currMap.tileBoard[x, y] = types;

                Tile newTile = temp.GetComponent <Tile>();
                temp.GetComponent <Tile>().InitTile(data, types);

                pathfinding.AddTile(newTile, x, y);

                // temp.transform.position = Globals.HeightCorrectedPosition(pathfinding.tiles[x, y]);
                temp.transform.position = Globals.GridToWorld(x, y);

                temp.GetComponent <SpriteRenderer>().sprite = atlas.GetSprite(types.spriteFilePath);
                temp.name = x + " " + y;

                // we create a concection between the tile effects on the map and the
            }
        }

        if (currentMission.started == false)
        {
            foreach (Tuple <MapCoords, List <string> > key in currentMission.initTileEffects)
            {
                int x = key.ele1.X;
                int y = key.ele1.Y;

                List <TileEffect> effects = new List <TileEffect>();

                foreach (string s in key.ele2)
                {
                    effects.Add(Globals.campaign.GetTileData().Effects.GetCopy(s));
                }

                pathfinding.tiles[x, y].tileEffects = effects;
                pathfinding.tiles[x, y].InitTileEffect();
                pathfinding.tiles[x, y].InitTileEffectsVisuals();
                pathfinding.tiles[x, y].ProcessEffectQueue();
            }
        }

        pathfinding.PopulateNieghbors();
    }
Ejemplo n.º 6
0
 public Shop GetShopCopy(string key)
 {
     return(ShopDB.GetCopy(key));
 }