Fixed tests. Need to check for damage from AI code
This commit is contained in:
+5
-2
@@ -1,14 +1,16 @@
|
||||
# Nathan Hinton 30 Dec 2025
|
||||
# Ship file for the game
|
||||
# Represents a space-faring vessel owned by a player.
|
||||
# Handles movement and validation of ship creation.
|
||||
|
||||
require 'securerandom'
|
||||
|
||||
# Load the ships into a constant:
|
||||
require 'yaml'
|
||||
# Configuration data for all available ships
|
||||
SHIP_DATA = File.open('lib/game/data/ships.yaml', 'r') do |fi|
|
||||
YAML.safe_load(fi.read())
|
||||
end
|
||||
|
||||
# Represents a space-faring vessel owned by a player.
|
||||
class Ship
|
||||
|
||||
attr_reader :owner, :position
|
||||
@@ -143,5 +145,6 @@ class Ship
|
||||
end
|
||||
|
||||
# Error class for ships
|
||||
# Represents a space-faring vessel owned by a player.
|
||||
class ShipError < StandardError
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user