public void InitData(IUnitData data, ChangeStorage storage)
 {
     _storage = storage;
     Id       = data.Id;
     Shards   = data.Shards;
     Stars    = data.Stars;
     Exp      = data.Exp;
     Level    = data.Level;
     LD_Abilities.Init(data.Abilities, storage);
     LD_PerkStars.Init(data.PerkStars, storage);
     LD_PerkCharges.Init(data.PerkCharges, storage);
     LD_Equipment.Init(data.Equipment, storage);
     EquipmentStars = data.EquipmentStars;
     LD_Buffs.Init(data.Buffs, storage);
     ExplorerPosition = data.ExplorerPosition;
     Reserve          = data.Reserve;
     CurrentHp        = data.CurrentHp;
     FamiliarUnlock   = data.FamiliarUnlock;
     MissionCounter   = data.MissionCounter;
 }
 public void InitData(IUnitDataClient client, ChangeStorage storage)
 {
     _storage = storage;
     Id       = client.Id;
     client.Shards.Subscribe(x => _Shards = x).AddTo(_disposables);
     client.Stars.Subscribe(x => _Stars   = x).AddTo(_disposables);
     client.Exp.Subscribe(x => _Exp       = x).AddTo(_disposables);
     client.Level.Subscribe(x => _Level   = x).AddTo(_disposables);
     LD_Abilities.Init(client.Abilities, storage);
     LD_PerkStars.Init(client.PerkStars, storage);
     LD_PerkCharges.Init(client.PerkCharges, storage);
     LD_Equipment.Init(client.Equipment, storage);
     client.EquipmentStars.Subscribe(x => _EquipmentStars = x).AddTo(_disposables);
     LD_Buffs.Init(client.Buffs, storage);
     client.ExplorerPosition.Subscribe(x => _ExplorerPosition = x).AddTo(_disposables);
     client.Reserve.Subscribe(x => _Reserve               = x).AddTo(_disposables);
     client.CurrentHp.Subscribe(x => _CurrentHp           = x).AddTo(_disposables);
     client.FamiliarUnlock.Subscribe(x => _FamiliarUnlock = x).AddTo(_disposables);
     client.MissionCounter.Subscribe(x => _MissionCounter = x).AddTo(_disposables);
 }
Exemplo n.º 3
0
 public void InitData(string root, ChangeStorage storage)
 {
     _storage         = storage;
     DataId           = $"{root}.{DataId}";
     Interface_Id     = _Id;
     Interface_Shards = new ReactiveProperty <Int32>(_Shards);
     Interface_Stars  = new ReactiveProperty <Int32>(_Stars);
     Interface_Exp    = new ReactiveProperty <Int32>(_Exp);
     Interface_Level  = new ReactiveProperty <Int32>(_Level);
     LD_Abilities?.Init($"{DataId}.abilities", storage, _Abilities);
     LD_PerkStars?.Init($"{DataId}.perks", storage, _PerkStars);
     LD_PerkCharges?.Init($"{DataId}.perk_charges", storage, _PerkCharges);
     LD_Equipment?.Init($"{DataId}.equipment", storage, _Equipment);
     Interface_EquipmentStars = new ReactiveProperty <Int32>(_EquipmentStars);
     LD_Buffs?.Init($"{DataId}.buffs", storage, _Buffs);
     Interface_ExplorerPosition = new ReactiveProperty <Int32>(_ExplorerPosition);
     Interface_Reserve          = new ReactiveProperty <Boolean>(_Reserve);
     Interface_CurrentHp        = new ReactiveProperty <Single>(_CurrentHp);
     Interface_FamiliarUnlock   = new ReactiveProperty <Boolean>(_FamiliarUnlock);
     Interface_MissionCounter   = new ReactiveProperty <Int32>(_MissionCounter);
 }
Exemplo n.º 4
0
 public IReadOnlyReactiveProperty <Int32?> GetPerkChargesProperty(Int32 key)
 {
     return(LD_PerkCharges.GetProperty(key));
 }