Working visibility (at least relatively good), but a few lines untested
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
import unittest
|
||||
|
||||
from squirrelbattle.display.texturepack import TexturePack
|
||||
from squirrelbattle.interfaces import Map, Tile
|
||||
from squirrelbattle.interfaces import Map, Tile, Slope
|
||||
from squirrelbattle.resources import ResourceManager
|
||||
|
||||
|
||||
@ -37,3 +37,21 @@ class TestInterfaces(unittest.TestCase):
|
||||
self.assertFalse(Tile.WALL.can_walk())
|
||||
self.assertFalse(Tile.EMPTY.can_walk())
|
||||
self.assertRaises(ValueError, Tile.from_ascii_char, 'unknown')
|
||||
|
||||
def test_slope(self) -> None:
|
||||
"""
|
||||
Test good behaviour of slopes (basically vectors, compared according to
|
||||
the determinant)
|
||||
"""
|
||||
a = Slope(1, 1)
|
||||
b = Slope(0, 1)
|
||||
self.assertTrue(b < a)
|
||||
self.assertTrue(b <= a)
|
||||
self.assertTrue(a <= a)
|
||||
self.assertTrue(a == a)
|
||||
self.assertTrue(a > b)
|
||||
self.assertTrue(a >= b)
|
||||
|
||||
# def test_visibility(self) -> None:
|
||||
# m = Map.load(ResourceManager.get_asset_path("example_map_3.txt"))
|
||||
# m.compute_visibility(1, 1, 50)
|
||||
|
Reference in New Issue
Block a user