Exemplo n.º 1
0
 public UtilModel(string token, string name, string description, string location, UtilType type)
 {
     _token       = token;
     _name        = name;
     _description = description;
     _location    = location;
     _type        = type;
 }
Exemplo n.º 2
0
 public UtilCounter GetCounter(UtilType type)
 {
     if (this._allCounters != null && this._allCounters.ContainsKey(type))
     {
         return(this._allCounters[type]);
     }
     return(null);
 }
Exemplo n.º 3
0
        public AddUtilControlViewModel(UtilType utilType)
        {
            _type = utilType;

            _container = ServiceLocator.Current.GetInstance <IContainerExtension>();
            _utilData  = _container.Resolve <AppData>().UtilsData;

            _eventAggregator = ServiceLocator.Current.GetInstance <IEventAggregator>();
            _addUtilEvent    = _eventAggregator.GetEvent <AddUtilEvent>();

            AddCommand  = new DelegateCommand(Add, CanAdd);
            ScanCommand = new DelegateCommand(Scan);
        }
Exemplo n.º 4
0
 public GoldCounter(UtilType type) : base(type)
 {
 }
Exemplo n.º 5
0
 public ExpCounter(UtilType type) : base(type)
 {
 }
Exemplo n.º 6
0
        /// <summary>
        /// Sets the object with the path.
        /// </summary>
        /// <param name="_path">The _path.</param>
        public void SetObject(string _path)
        {
            bool found = false;

            foreach (TrapType type in Enum.GetValues(typeof(TrapType)))
            {
                if (ToDescriptionString(type) == _path)
                {
                    trapType = type;
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                foreach (BonusType type in Enum.GetValues(typeof(BonusType)))
                {
                    if (ToDescriptionString(type) == _path)
                    {
                        bonusType = type;
                        found = true;
                        break;
                    }
                }
            }

            if (!found)
            {
                foreach (UtilType type in Enum.GetValues(typeof(UtilType)))
                {
                    if (ToDescriptionString(type) == _path)
                    {
                        utilType = type;
                        break;
                    }
                }
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// Gets the path of the utilities type.
 /// </summary>
 /// <param name="val">The value.</param>
 /// <returns></returns>
 public static string ToDescriptionString(UtilType val)
 {
     DescriptionAttribute[] attributes = (DescriptionAttribute[])val.GetType().GetField(val.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
     return attributes.Length > 0 ? attributes[0].Description : string.Empty;
 }
Exemplo n.º 8
0
 public TowerCounter(UtilType type) : base(type)
 {
 }
Exemplo n.º 9
0
 public UtilModel(string location, string description, UtilType type)
 {
     _location    = location;
     _type        = type;
     _description = description;
 }
Exemplo n.º 10
0
 public UtilCounter(UtilType type)
 {
     this._type         = type;
     this._lookingTable = new Dictionary <int, CounterValue>();
 }
Exemplo n.º 11
0
 public SkillCounter(UtilType type) : base(type)
 {
 }
Exemplo n.º 12
0
 public T GetComponent <T>() where T : instance_behaviour.Behaviour
 {
     return(GetComponent(UtilType.GetTypeName(typeof(T))) as T);
 }