public override bool MakeMove(GameboardImpl gameboard) { GameboardCell new_cell = gameboard.cells[target_cell.board_x, target_cell.board_y]; if (new_cell.unit != null) { return(false); } OrientedCell or_cell = new OrientedCell { cell = new_cell, orientation = orient }; gameboard.AddUnit(gameboard.commands[gameboard.cur_command_idx].hand[card_idx], or_cell); return(true); }
public override bool MakeMove(GameboardImpl gameboard) { UnitImpl new_unit_to_kill = gameboard.cells[unit_to_kill_place.board_x, unit_to_kill_place.board_y].unit; if (new_unit_to_kill == null) { return(false); } UnitImpl new_unit = new UnitImpl(gameboard.commands [gameboard.cur_command_idx].hand [card_idx], gameboard.cur_command_idx, new_unit_to_kill.oriented_cell); gameboard.AddUnit(gameboard.commands[gameboard.cur_command_idx].hand[card_idx], null); if (new_unit_to_kill.notificator != null) { new_unit_to_kill.notificator.PlayBlockAnimation(isHealing); } GetDamage(gameboard, new_unit_to_kill, new_unit); return(true); }