Add ship validity checking

This commit is contained in:
asraelite 2018-03-05 17:12:00 +00:00
parent 986c0479f1
commit 52770d7eb2
5 changed files with 72 additions and 16 deletions

View file

@ -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() {