Move part of game code to Game namespace
This commit is contained in:
@ -4,7 +4,7 @@ require "./../src/game/command"
|
||||
|
||||
macro define_dummy_classes(count)
|
||||
{% for i in (1...count) %}
|
||||
class Test::DummyCommand{{ i }} < Command
|
||||
class Test::DummyCommand{{ i }} < Game::Command
|
||||
def start(world) : Int32
|
||||
end
|
||||
|
||||
|
@ -3,18 +3,18 @@ require "../src/game/world"
|
||||
|
||||
describe "World" do
|
||||
it "should build crystal harvester" do
|
||||
world = World.new
|
||||
world = Game::World.new
|
||||
point = Point.new(2, 3)
|
||||
cmd = BuildCrystalHarvesterCommand.new(point)
|
||||
cmd = Game::BuildCrystalHarvesterCommand.new(point)
|
||||
world.push(cmd)
|
||||
world.run(100)
|
||||
world.map.get(point).has_role(TileRole::CrystalHarvester)
|
||||
end
|
||||
|
||||
it "should fail when not enought resources" do
|
||||
world = World.new
|
||||
world = Game::World.new
|
||||
point = Point.new(2, 3)
|
||||
cmd = BuildCrystalRestorerCommand.new(point)
|
||||
cmd = Game::BuildCrystalRestorerCommand.new(point)
|
||||
expect_raises(NotEnoughtResources) do
|
||||
world.push(cmd)
|
||||
end
|
||||
|
Reference in New Issue
Block a user