Skip to content

Commit

Permalink
add distance implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
spitant committed Jan 8, 2016
1 parent 42e525c commit 467c1ad
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 56 deletions.
2 changes: 1 addition & 1 deletion prototypes/battle/source/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion prototypes/battle/source/.idea/source.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

111 changes: 58 additions & 53 deletions prototypes/battle/source/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion prototypes/battle/source/battle/landBattleField.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@ def draw(self, scene):
item.setZValue(1001)
scene.addItem(item)



def distance(self, field):
"""function distance
:param field: LandBattleField
returns int
"""
raise NotImplementedError()
return (abs(self.sx - field.sx)
+ abs(self.sx + self.sy - field.sx - field.sy)
+ abs(self.sy - field.sy)) / 2

0 comments on commit 467c1ad

Please sign in to comment.