forked from acm-ndsu/byte_le_engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests for station & test fixes (#31)
* tests for station & test fixes + test_station made + fixed take_action in station to default pass + added examples for stations and occupiable_stations + fixed interact_controller with new example stations + added example stations to enums + changed item class - default durability now: None - changed order of json methods * tests for master_controller + fixed master_controller + fixed match case in player and object_type setter + fixed tile match case + fixed game_board + fixed issue with game_object + user_client: capitalized CLIENT, added avatar to take_turn + added avatar to take_turn in base_client and base_client_2 + changed current_world to self.world in engine + made temp game_board in generate_game * extra test fixes * Update player.py * comment for station_receiver_example
- Loading branch information
1 parent
8ca5d9e
commit 37a3662
Showing
20 changed files
with
167 additions
and
60 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
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
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from game.common.avatar import Avatar | ||
from game.common.enums import ObjectType | ||
from game.common.items.item import Item | ||
from game.common.stations.occupiable_station import OccupiableStation | ||
|
||
# create example of occupiable_station that gives item | ||
class OccupiableStationExample(OccupiableStation): | ||
def __init__(self, held_item: Item | None = None): | ||
super().__init__(held_item=held_item) | ||
self.object_type = ObjectType.STATION_EXAMPLE | ||
|
||
def take_action(self, avatar: Avatar) -> Item | None: | ||
avatar.pick_up(self.held_item) |
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,13 @@ | ||
from game.common.avatar import Avatar | ||
from game.common.enums import ObjectType | ||
from game.common.items.item import Item | ||
from game.common.stations.station import Station | ||
|
||
# create example of station that gives item to avatar | ||
class StationExample(Station): | ||
def __init__(self, held_item: Item | None = None): | ||
super().__init__(held_item=held_item) | ||
self.object_type = ObjectType.STATION_EXAMPLE | ||
|
||
def take_action(self, avatar: Avatar) -> Item | None: | ||
avatar.pick_up(self.held_item) |
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,15 @@ | ||
from game.common.avatar import Avatar | ||
from game.common.enums import ObjectType | ||
from game.common.items.item import Item | ||
from game.common.stations.station import Station | ||
|
||
# create example of station that takes held_item from avatar at inventory slot 0 | ||
class StationReceiverExample(Station): | ||
def __init__(self, held_item: Item | None = None): | ||
super().__init__(held_item=held_item) | ||
self.object_type = ObjectType.STATION_RECEIVER_EXAMPLE | ||
|
||
def take_action(self, avatar: Avatar) -> None: | ||
self.held_item = avatar.held_item | ||
# assuming held_item is stored at index 0 in inventory | ||
avatar.inventory.pop(0) |
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
Oops, something went wrong.