1extends "res://scripts/bag_aware.gd"
2
3var hands = {
4    "spawn" : preload("res://scripts/ai/actions/hands/spawn_hand.gd").new(),
5    "move" : preload("res://scripts/ai/actions/hands/move_hand.gd").new(),
6}
7
8
9func _initialize():
10    for hand_name in self.hands:
11        self.hands[hand_name]._init_bag(self.bag)
12
13
14func execute(action):
15    var hand = self._get_hand(action)
16    hand.execute(action)
17    action.proceed()
18
19
20func _get_hand(action):
21    for hand_name in self.hands:
22        if action extends self.hands[hand_name].handled_action:
23            return self.hands[hand_name]
24