예제 #1
0
 public UtilModel(string token, string name, string description, string location, UtilType type)
 {
     _token       = token;
     _name        = name;
     _description = description;
     _location    = location;
     _type        = type;
 }
예제 #2
0
 public UtilCounter GetCounter(UtilType type)
 {
     if (this._allCounters != null && this._allCounters.ContainsKey(type))
     {
         return(this._allCounters[type]);
     }
     return(null);
 }
예제 #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);
        }
예제 #4
0
 public GoldCounter(UtilType type) : base(type)
 {
 }
예제 #5
0
 public ExpCounter(UtilType type) : base(type)
 {
 }
예제 #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;
                    }
                }
            }
        }
예제 #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;
 }
예제 #8
0
 public TowerCounter(UtilType type) : base(type)
 {
 }
예제 #9
0
 public UtilModel(string location, string description, UtilType type)
 {
     _location    = location;
     _type        = type;
     _description = description;
 }
예제 #10
0
 public UtilCounter(UtilType type)
 {
     this._type         = type;
     this._lookingTable = new Dictionary <int, CounterValue>();
 }
예제 #11
0
 public SkillCounter(UtilType type) : base(type)
 {
 }
예제 #12
0
 public T GetComponent <T>() where T : instance_behaviour.Behaviour
 {
     return(GetComponent(UtilType.GetTypeName(typeof(T))) as T);
 }