in MalmoEnv/malmoenv/commands.py [0:0]
def _fill_command_list(self, command_type, turnbased, allow, deny):
# Add allow defaults for empty allow list.
if not allow:
if command_type == CommandParser.discreteMovementCommands:
allow = [(command_type, turnbased, c) for c in CommandParser.all_discrete]
elif command_type == CommandParser.continuousMovementCommands:
allow = [(command_type, turnbased, c) for c in CommandParser.all_continuous]
elif command_type == CommandParser.absoluteMovementCommands:
allow = [(command_type, turnbased, c) for c in CommandParser.all_absolute]
elif command_type == CommandParser.humanLevelCommands:
allow = [(command_type, turnbased, c) for c in CommandParser.all_human_level]
elif command_type == CommandParser.simpleCraftCommands:
allow = [(command_type, turnbased, c) for c in CommandParser.all_simplecraft]
elif command_type == CommandParser.nearbyCraftCommands:
allow = [(command_type, turnbased, c) for c in CommandParser.all_nearbycraft]
elif command_type == CommandParser.nearbySmeltCommands:
allow = [(command_type, turnbased, c) for c in CommandParser.all_nearbysmelt]
elif command_type == CommandParser.missionQuitCommands:
allow = [(command_type, turnbased, c) for c in CommandParser.missionQuitCommands]
elif command_type == CommandParser.chatCommands:
allow = [(command_type, turnbased, c) for c in CommandParser.all_chat]
elif command_type == CommandParser.inventoryCommands:
allow = [(command_type, turnbased, c) for c in CommandParser.all_inventory]
# Remove all denied.
for d in deny:
while d in allow:
allow.remove(d)
# Restrict to (optional) competition commands.
if len(self.action_filter) > 0:
filtered = [(command_type, turnbased, c) for c in self.action_filter]
return [a for a in allow if a in filtered]
else:
return allow