mirror of
https://github.com/JohnBreaux/Boat-Battle.git
synced 2024-11-15 05:25:57 +00:00
Added player class functionality
This commit is contained in:
parent
83f319b76c
commit
8e4600eede
@ -25,19 +25,16 @@ func hit(pos):
|
|||||||
|
|
||||||
# place_ship: called when ships are placed.
|
# place_ship: called when ships are placed.
|
||||||
# forwards Ship locations to the Board, so that it may construct a ship
|
# forwards Ship locations to the Board, so that it may construct a ship
|
||||||
# ship: a list of ship properties {position, orientation, size}
|
# ship: a list of ship properties {position, orientation, size, variant}
|
||||||
# NOTE: Variant? Assuming _ship is an array of lists of ship properties
|
func place_ship(pos, size, orientation, variant):
|
||||||
func place_ship(_ship):
|
board.place_ship(pos, size, orientation, variant)
|
||||||
for i in _ship:
|
|
||||||
board.place_ship(i)
|
|
||||||
pass
|
|
||||||
|
|
||||||
# setUp: set up the board given the placed ship locations
|
# setUp: set up the board given the placed ship locations
|
||||||
# translates the ship positions in the Setup UI to board-space, then places each ship
|
# translates the ship positions in the Setup UI to board-space, then places each ship
|
||||||
# ships: a list of lists of ship properties {{position, orientation, size}, ...}
|
# ships: a list of lists of ship properties {{position, orientation, size, variant}, ...}
|
||||||
# NOTE: What is the difference place_ship() and set_up()
|
func set_up(ships):
|
||||||
func set_up(_ships):
|
for i in ships:
|
||||||
pass
|
place_ship(ships[i].Position, ships[i].Size, ships.Orientation, ships[i].Variant)
|
||||||
|
|
||||||
# turnStart: start player's turn
|
# turnStart: start player's turn
|
||||||
# Initiates the player's turn, and blocks until the player selects a location to fire upon
|
# Initiates the player's turn, and blocks until the player selects a location to fire upon
|
||||||
|
Loading…
Reference in New Issue
Block a user