Beispiel #1
0
    public static List <Vector3> GenerateChunkIDsList(HexCords chunk_id)
    {
        List <Vector3> id_list = new List <Vector3>();

        HexCords center = HexCords.FromChunkId(chunk_id);

        id_list.AddRange(CreateCellsRadiusIDsList(center, 6));
        id_list.AddRange(HexCords.CornersIdsFromCenterId(center));
        return(id_list);
    }
Beispiel #2
0
    private void GenerateCellsIDs()
    {
        //Fills cells_ids with hex coords of the cells which are supposed to be in the chunk

        HexCords center_cell = HexCords.FromChunkId(new HexCords(hex_id));

        foreach (Vector3 cell_id in HexMetrics.cells_in_chunk)
        {
            cells_ids.Add(cell_id + center_cell.hex_crds);
        }

        /*HexCords center_cell = HexCords.FromChunkId(new HexCords(hex_id));
         *
         * foreach (Vector3 cord in HexCords.CreateCellsRadiusIDsList(center_cell, 6))
         * {
         *  cells_ids.Add(new Vector3((int)cord.x, (int)cord.y, (int)cord.z));
         * }
         * foreach (Vector3 cord in HexCords.CornersIdsFromCenterId(center_cell))
         * {
         *  cells_ids.Add(new Vector3((int)cord.x, (int)cord.y, (int)cord.z));
         * }*/
    }