Exemplo n.º 1
0
        public void Initialize(
            InventoryWatcher inventoryWatcher,
            FormationWatcher formationWatcher
            )
        {
            _inventoryWatcher = inventoryWatcher;
            _formationWatcher = formationWatcher;

            void OnDoneSetupWatcher()
            {
                for (var i = 0; i < _formationWatcher.MoldModel.MaxCapacity; i++)
                {
                    var row = Instantiate(partyListRowPrefab, verticalLayoutGroup.transform);
                    row.Initialize(
                        _inventoryWatcher,
                        _formationWatcher,
                        i,
                        false,
                        onChoiceParty,
                        new ChoiceSlotEvent()
                        );
                    row.gameObject.SetActive(true);
                    _rows.Add(row);
                }

                _formationWatcher.onWatchFormation.AddListener(OnChangeFormation);
            }

            _formationWatcher.onDoneSetup.AddListener(OnDoneSetupWatcher);

            _rows = new List <PartyListRow>();
        }
Exemplo n.º 2
0
        public void Initialize(
            InventoryWatcher unitWatcher,
            FormationWatcher partyWatcher,
            int moldIndex,
            EzForm form
            )
        {
            _unitWatcher  = unitWatcher;
            _partyWatcher = partyWatcher;
            _unitWatcher.onWatchInventoryEvent.AddListener(OnChangeInventory);
            _partyWatcher.onWatchFormation.AddListener(OnChangeFormation);

            _form = form;

            OnChangeFormation(
                _partyWatcher.MoldModel,
                moldIndex,
                form
                );
        }
Exemplo n.º 3
0
        public void Initialize(
            InventoryWatcher inventoryWatcher,
            FormationWatcher formationWatcher,
            int index,
            ChoiceSlotEvent onChoiceSlot
            )
        {
            _formationWatcher = formationWatcher;

            _partyInformation = Instantiate(partyListRowPrefab, transform);
            _partyInformation.Initialize(
                inventoryWatcher,
                _formationWatcher,
                index,
                true,
                new ChoicePartyEvent(),
                onChoiceSlot
                );
            _partyInformation.gameObject.SetActive(true);
            gameObject.SetActive(true);
        }
Exemplo n.º 4
0
        public void Initialize(
            InventoryWatcher inventoryWatcher,
            FormationWatcher formationWatcher,
            int index,
            bool enableSelectUnit,
            ChoicePartyEvent onChoiceParty,
            ChoiceSlotEvent onChoiceSlot
            )
        {
            _inventoryWatcher = inventoryWatcher;
            _formationWatcher = formationWatcher;
            _index            = index;
            _enableSelectUnit = enableSelectUnit;
            _onChoiceParty    = onChoiceParty;
            _onChoiceSlot     = onChoiceSlot;
            _formationWatcher.onWatchFormation.AddListener(OnChangeFormation);

            OnChangeFormation(
                _formationWatcher.MoldModel,
                _index,
                _formationWatcher.Forms.FirstOrDefault(form => form.Index == index)
                );
        }
Exemplo n.º 5
0
 public void Start()
 {
     _formationWatcher = new FormationWatcher();
     _partySetting     = GetComponent <PartySetting>();
 }