Skip to content

Commit

Permalink
Merge pull request #94 from CarperAI/no-args
Browse files Browse the repository at this point in the history
Removed all args() from action.py
  • Loading branch information
daveey committed Jul 21, 2023
2 parents 1742825 + b6406f1 commit 530d044
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions nmmo/core/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ def N(cls, config):
def deserialize(realm, entity, index):
return index

def args(stim, entity, config):
return []

class Fixed:
pass

Expand All @@ -76,7 +73,7 @@ def hook(config):
arguments = []
for action in Action.edges(config):
action.init(config)
for args in action.edges:
for args in action.edges: # pylint: disable=not-an-iterable
args.init(config)
if not 'edges' in args.__dict__:
continue
Expand Down Expand Up @@ -106,9 +103,6 @@ def edges(cls, config):
edges.append(Comm)
return edges

def args(stim, entity, config):
raise NotImplementedError

class Move(Node):
priority = 60
nodeType = NodeType.SELECTION
Expand Down Expand Up @@ -169,9 +163,6 @@ class Direction(Node):
def edges():
return [North, South, East, West, Stay]

def args(stim, entity, config):
return Direction.edges

def deserialize(realm, entity, index):
return deserialize_fixed_arg(Direction, index)

Expand Down Expand Up @@ -284,9 +275,6 @@ class Style(Node):
def edges():
return [Melee, Range, Mage]

def args(stim, entity, config):
return Style.edges

def deserialize(realm, entity, index):
return deserialize_fixed_arg(Style, index)

Expand Down Expand Up @@ -314,10 +302,6 @@ def deserialize(realm, entity, index: int):
entity_id = entity_obs[index, Entity.State.attr_name_to_col["id"]]
return realm.entity_or_none(entity_id)

def args(stim, entity, config):
#Should pass max range?
return Attack.in_range(entity, stim, config, None)

class Melee(Node):
nodeType = NodeType.ACTION
freeze=False
Expand Down Expand Up @@ -355,9 +339,6 @@ class InventoryItem(Node):
def N(cls, config):
return config.INVENTORY_N_OBS + 1 # +1 for the "None" item

def args(stim, entity, config):
return stim.exchange.items()

def deserialize(realm, entity, index: int):
# NOTE: index is from the inventory, NOT item id
if index >= realm.config.INVENTORY_N_OBS or index < 0: # checking for the "None" item
Expand Down Expand Up @@ -547,9 +528,6 @@ class MarketItem(Node):
def N(cls, config):
return config.MARKET_N_OBS + 1 # +1 for the "None" item

def args(stim, entity, config):
return stim.exchange.items()

def deserialize(realm, entity, index: int):
# NOTE: index is from the market, NOT item id
if index >= realm.config.MARKET_N_OBS or index < 0: # checking for the "None" item
Expand Down Expand Up @@ -668,9 +646,6 @@ def init(cls, config):
def edges():
return Price.classes

def args(stim, entity, config):
return Price.edges

def deserialize(realm, entity, index):
return deserialize_fixed_arg(Price, index)

Expand All @@ -685,9 +660,6 @@ def init(cls, config):
def edges():
return Token.classes

def args(stim, entity, config):
return Token.edges

def deserialize(realm, entity, index):
return deserialize_fixed_arg(Token, index)

Expand Down

0 comments on commit 530d044

Please sign in to comment.