Пример #1
0
 def test_move_on_friendly_far(self):
     m = Map(3, 10)
     m.generate_from_ascii("models/maps/corridor.txt")
     g = GreaserUnit(0, 0, m, CONST.jets)
     g1 = GreaserUnit(0, 5, m, CONST.jets)
     assert (not g.move(0, 5))
     assert (g.move(0, 4))
Пример #2
0
 def testMoveAroundEnemy(self):
     m = Map(3, 10)
     m.generate_from_ascii("models/maps/corridor.txt")
     g = GreaserUnit(1, 2, m, CONST.jets)
     b1 = BruiserUnit(2, 3, m, CONST.sharks)  ##blocked by teammate
     b2 = BruiserUnit(1, 3, m, CONST.sharks)  ##blocked by teammate
     assert (g.move(1, 4))
Пример #3
0
 def test_simple_move(self):
     m = Map(10, 10)
     m.generate_from_ascii("models/maps/10by10.txt")
     g = GreaserUnit(4, 4, m, CONST.jets)
     assert (g.move(5, 4))
     assert (g.x == 5 and g.y == 4)
     assert (m.unit_at(5, 4) is g)
Пример #4
0
 def testMoveThroughFriendly(self):
     m = Map(10, 10)
     m.generate_from_ascii("models/maps/10by10funnel.txt")
     g = GreaserUnit(4, 3, m, CONST.jets)
     b = BruiserUnit(4, 4, m, CONST.jets)  ##blocked by teammate
     assert (g.move(4, 6))
     assert (g.x == 4 and g.y == 6)
     assert (m.unit_at(4, 6) is g)
Пример #5
0
 def testMoveThroughEnemy(self):
     m = Map(10, 10)
     m.generate_from_ascii("models/maps/10by10funnel.txt")
     g = GreaserUnit(8, 3, m, CONST.jets)
     b = BruiserUnit(8, 4, m, CONST.sharks)  ##blocked by teammate
     assert (not g.move(8, 5))
Пример #6
0
 def testMoveTooFar(self):
     m = Map(10, 10)
     m.generate_from_ascii("models/maps/10by10funnel.txt")
     g = GreaserUnit(8, 1, m, CONST.jets)
     assert (not g.move(1, 6))
     assert (g.move(6, 3))
Пример #7
0
 def test_a_star_issue(self):
     m = Map(32, 18)
     m.generate_from_ascii("models/maps/32by18.txt")
     g = GreaserUnit(4, 10, m, CONST.jets)
     g.move(0, 10)