Package it.polimi.ingsw.model
Class Cell
- java.lang.Object
-
- it.polimi.ingsw.model.Cell
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBlock(Block blockToAdd)
Add a block on top of the stackCell
clone()
Block
getBlock()
Get the top block of the stackBlock
getBlock(int i)
Get a specific block of the stackint
getSize()
Get the number of blocks in the CellBlock
popBlock()
Remove and Return the top block of the stack, null in case there is nothing
-
-
-
Method Detail
-
addBlock
public void addBlock(Block blockToAdd)
Add a block on top of the stack- Parameters:
blockToAdd
- block to add
-
popBlock
public Block popBlock()
Remove and Return the top block of the stack, null in case there is nothing- Returns:
- top block on the stack
-
getBlock
public Block getBlock()
Get the top block of the stack- Returns:
- Top block of the stack
-
getBlock
public Block getBlock(int i)
Get a specific block of the stack- Parameters:
i
- position of the block on the stack- Returns:
- block selected, in case i is invalid, it is returned the closest block
-
getSize
public int getSize()
Get the number of blocks in the Cell- Returns:
- number of blocks in the Cell
-
-