예제 #1
0
        /// <summary>
        /// Constructor for entity with droplist.
        /// Must be used only in InitEntityRelationships phase.
        /// </summary>
        /// <param name="ammoViewModel">View Model of ammo.</param>
        /// <param name="gunViewModel">View Model of gun that uses that ammo.</param>
        public AmmoUsageViewModel([NotNull] ProtoEntityViewModel ammoViewModel,
                                  [NotNull] ProtoEntityViewModel gunViewModel)
            : base(ammoViewModel.ProtoEntity)
        {
            if (!EntityViewModelsManager.EntityDictonaryCreated)
            {
                throw new Exception("CNEI: Droplist constructor used before all entity VMs sets.");
            }

            AmmoEntity = ammoViewModel;

            InputItemsList.Add(ammoViewModel);

            //GunsVMList.Add(gunViewModel);
            GunsInformationList.Add(new ViewModelEntityWithCount(gunViewModel));
        }
예제 #2
0
 public void AddAmmoUsage([NotNull] ProtoEntityViewModel gunViewModel)
 {
     //GunsVMList.Add(gunViewModel);
     GunsInformationList.Add(new ViewModelEntityWithCount(gunViewModel));
 }