This repository has been archived by the owner on Feb 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dmitriy Tolmachev
committed
Dec 10, 2012
1 parent
220e4d6
commit fe51bbe
Showing
10 changed files
with
113 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import os | ||
from map.map import Map | ||
|
||
def main(): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__author__ = 'sunlight' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from actors.bottle import Bottle | ||
from way_finder import WayFinder | ||
|
||
class BeggarWayFinder(WayFinder): | ||
def __init__(self, map, start, end): | ||
WayFinder.__init__(self, map, start, end) | ||
|
||
|
||
def valid_field_to_step(self, coordinate) : | ||
if self._map.has_actor_at(coordinate): | ||
actor = self._map.get(coordinate) | ||
if isinstance(actor, Bottle) : | ||
return True | ||
return False | ||
else : | ||
return True |
13 changes: 13 additions & 0 deletions
13
tolmachev_co/map/way_finder/beggar_way_finder_with_bottle.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from actors.bottle import Bottle | ||
from way_finder import WayFinder | ||
|
||
class BeggarWayFinderWithBottle(WayFinder): | ||
def __init__(self, map, start, end): | ||
WayFinder.__init__(self, map, start, end) | ||
|
||
|
||
def valid_field_to_step(self, coordinate) : | ||
if self._map.has_actor_at(coordinate): | ||
return False | ||
else : | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from actors.alcoholic import Alcoholic | ||
from way_finder import WayFinder | ||
|
||
class PolicemanWayFinder(WayFinder): | ||
def __init__(self, map, start, end): | ||
WayFinder.__init__(self, map, start, end) | ||
|
||
|
||
def valid_field_to_step(self, coordinate) : | ||
if self._map.has_actor_at(coordinate): | ||
actor = self._map.get(coordinate) | ||
if isinstance(actor, Alcoholic) : | ||
if actor.is_sleeping() : | ||
return True | ||
return False | ||
else : | ||
return True | ||
|
12 changes: 12 additions & 0 deletions
12
tolmachev_co/map/way_finder/policeman_way_finder_with_alcoholic.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from way_finder import WayFinder | ||
|
||
class PolicemanWayFinderWithAlcoholic(WayFinder): | ||
def __init__(self, map, start, end): | ||
WayFinder.__init__(self, map, start, end) | ||
|
||
|
||
def valid_field_to_step(self, coordinate) : | ||
if self._map.has_actor_at(coordinate): | ||
return False | ||
else : | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters