Ejemplo n.º 1
0
    public ArrayList getBlockInventory()
    {
        //returns an arraylist of all blockstacks available for the player to place
        ArrayList inventory = new ArrayList();

        for (int i = 0; i < 112; i++)
        {
            BlockData bd = BlockDataLookup.getBlockDataByCode(i);
            inventory.Add(new BlockStack(bd, 10));
        }

        return(inventory);
    }
Ejemplo n.º 2
0
    public void createBlock(int blockCode, IntVector3 position)
    {
        if (!shipInfo.isInsideArray(position))
        {
            Debug.Log("aborted createBlock. bad coordinates: " + ZDebug.toString(position));
            return;
        }
        if (shipInfo.isBlockOccupied(position))
        {
            Debug.Log("aborted createBlock. occupied coordinates: " + ZDebug.toString(position));
            return;
        }

        BlockData blockData = BlockDataLookup.getBlockDataByCode(blockCode).getCopy();
        Block     block     = ship3DView.createBlock(blockData, position);

        shipModel.createBlock(blockData, position);
    }