Add ship validity checking
This commit is contained in:
parent
986c0479f1
commit
52770d7eb2
5 changed files with 72 additions and 16 deletions
|
@ -28,10 +28,15 @@ export function editShip() {
|
|||
}
|
||||
|
||||
export function endEditing() {
|
||||
graphics.changePerspective('universe');
|
||||
game.state.editing = false;
|
||||
game.state.inventory = false;
|
||||
edit.end();
|
||||
let {valid, reason} = edit.end();
|
||||
|
||||
if (valid) {
|
||||
graphics.changePerspective('universe');
|
||||
game.state.editing = false;
|
||||
game.state.inventory = false;
|
||||
} else {
|
||||
console.log(reason);
|
||||
}
|
||||
}
|
||||
|
||||
export function invalidTilePlacement() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue