Beispiel #1
0
        public static void LoadType(out Equipment_Type[] objects, int Level)
        {
            objects = null;

            string        strY = DateTime.Now.Year.ToString(new System.Globalization.CultureInfo("en-US"));
            StringBuilder sql  = new StringBuilder();

            sql.AppendLine("select * FROM [dbo].[Equipment_Type] ");
            sql.AppendLine("where ParentID = " + Level);

            DataTable dt = ClassMain.ExecuteComandTable(sql.ToString());

            if (dt != null && dt.Rows.Count > 0)
            {
                List <Equipment_Type> lstEquipment_Type = new List <Equipment_Type>();
                foreach (DataRow item in dt.Rows)
                {
                    Equipment_Type en = new Equipment_Type();
                    en.ID          = int.Parse(item["Id"].ToString());
                    en.TypeName    = item["TypeName"].ToString();
                    en.ParentID    = int.Parse(item["ParentID"].ToString());
                    en.CreatedDate = item["CreatedDate"] != DBNull.Value ? Convert.ToDateTime(item["CreatedDate"].ToString()) : (DateTime?)null;
                    en.CreatedBy   = item["CreatedBy"].ToString();
                    en.UpdatedDate = item["UpdatedDate"] != DBNull.Value ? Convert.ToDateTime(item["UpdatedDate"].ToString()) : (DateTime?)null;
                    en.UpdatedBy   = item["UpdatedBy"].ToString();

                    lstEquipment_Type.Add(en);
                }

                if (lstEquipment_Type != null && lstEquipment_Type.Any())
                {
                    objects = lstEquipment_Type.ToArray();
                }
            }
        }
 public void startUseEquipment(Equipment_Type type, float expiryTime)
 {
     EquipmentUsageScript usage = (EquipmentUsageScript) transform.GetComponent("EquipmentUsageScript");
     if(type==Equipment_Type.BOOTS){
         usage.useBoots(expiryTime);
     }
     else if(type==Equipment_Type.JACKET){
         usage.useJacket(expiryTime);
     }
 }
    public void startUseEquipment(Equipment_Type type, float expiryTime)
    {
        EquipmentUsageScript usage = (EquipmentUsageScript)transform.GetComponent("EquipmentUsageScript");

        if (type == Equipment_Type.BOOTS)
        {
            usage.useBoots(expiryTime);
        }
        else if (type == Equipment_Type.JACKET)
        {
            usage.useJacket(expiryTime);
        }
    }
Beispiel #4
0
 public Equipable(Equipment_Type _type)
 {
     Type = _type;
 }
 public Equipment(Equipment_Type eqType, float expiryTime)
 {
     this.eqType     = eqType;
     this.expiryTime = expiryTime;
 }
        float expiryTime; //how long the item will last

        #endregion Fields

        #region Constructors

        public Equipment(Equipment_Type eqType, float expiryTime)
        {
            this.eqType = eqType;
            this.expiryTime = expiryTime;
        }