Example #1
0
 public int Item_Modificar(int id, string descripcion)
 {
     Item              = new eItem();
     Item._id          = id;
     Item._descripcion = descripcion;
     Item.Item_Modificar();
     return(1);
 }
Example #2
0
        public DataSet Producto_Obtiene_Tablas()
        {
            DataSet           ds          = new DataSet();
            eGrupoInstrumento grupo       = new eGrupoInstrumento();
            eInstrumento      instrumento = new eInstrumento();

            Item = new eItem(3);

            ds.Tables.Add(grupo.GrupoInstrumento_Obtiene()); // validar
            ds.Tables.Add(instrumento.Instrumento_Obtiene());
            ds.Tables.Add(Item.Item_Obtener_Productos());

            return(ds);
        }
Example #3
0
    public List <int> GetItemStat(List <string> li_Temp)
    {
        li_ItemStat.Clear();

        int nAtk = 0;
        int nDef = 0;
        int nHP  = 0;

        for (int i = 0; i < li_Temp.Count; ++i)
        {
            eItem eItem = eItem.None;
            eItem = (eItem)Enum.Parse(typeof(eItem), li_Temp[i]);

            switch (eItem)
            {
            case eItem.sword1:
            case eItem.axe1:
            case eItem.top1:
            case eItem.top2:
            case eItem.bottom1:
            case eItem.bottom2:
            case eItem.Arm1:
            case eItem.Arm2:
            case eItem.helmet1:
            case eItem.helmet2:
            case eItem.shoes1:
            case eItem.shoes2:
                var data = eItem.GetItemType();
                nAtk += data.nAtk;
                nDef += data.nDef;
                nHP  += data.nHP;
                break;

            default:
                Debug.Log("착용하지 않은 아이템");
                break;
            }
        }

        //Debug.Log(nAtk);
        //Debug.Log(nDef);
        //Debug.Log(nHP);

        li_ItemStat.Add(nAtk);
        li_ItemStat.Add(nDef);
        li_ItemStat.Add(nHP);

        return(li_ItemStat);
    }
Example #4
0
        public DataSet GetData(eItem item, string str)
        {
            stBookData bookData = new stBookData(0, "", "");
            bookList = new ArrayList();
            DataSet ds = new DataSet();

            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string sql = "SELECT * FROM Book WHERE " + item.ToString() + "='" + str + "'";
                SQLiteDataAdapter adapter = new SQLiteDataAdapter(sql, conn);
                adapter.Fill(ds);
            }
            return ds;
        }
Example #5
0
        public DataSet GetData(eItem item, string str)
        {
            stBookData bookData = new stBookData(0, "", "");

            bookList = new ArrayList();
            DataSet ds = new DataSet();

            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string            sql     = "SELECT * FROM Book WHERE " + item.ToString() + "='" + str + "'";
                SQLiteDataAdapter adapter = new SQLiteDataAdapter(sql, conn);
                adapter.Fill(ds);
            }
            return(ds);
        }
Example #6
0
        public ArrayList Select_Reader(eItem item, string str)
        {
            stStudent StudentData = new stStudent(0, "", "");
            Student = new ArrayList();
            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string sql = "SELECT * FROM Student WHERE studentNum =\"" + str + "\"";

                SQLiteCommand cmd = new SQLiteCommand(sql, conn);
                SQLiteDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    StudentData.studentNum =Convert.ToInt32(rdr["studentNum"]);
                    StudentData.name = rdr["name"].ToString();
                    StudentData.phone = rdr["phone"].ToString();
                    Student.Add(Student);
                }
                rdr.Close();
            }
            return Student;
        }
Example #7
0
        public void Producto_Almacenar(string nombre, List <int> instrumentos)
        {
            // crear Item
            Item              = new eItem();
            Item._conceptoid  = 56;
            Item._descripcion = nombre;
            int indice = Item.Item_Almacenar();

            // crear productos (asociacion item <---> Instrumentos)
            if (indice != -1)
            {
                Producto              = new eProducto();
                Producto.ItemId       = indice;
                Producto.Instrumentos = instrumentos;
                Producto.Nombre       = nombre;
                Producto.Producto_Almacenar();
            }
            else
            {
                // eliminar item
            }
        }
Example #8
0
        public ArrayList Select_Reader(eItem item, string str)
        {
            stStudent StudentData = new stStudent(0, "", "");

            Student = new ArrayList();
            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string sql = "SELECT * FROM Student WHERE studentNum =\"" + str + "\"";

                SQLiteCommand    cmd = new SQLiteCommand(sql, conn);
                SQLiteDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    StudentData.studentNum = Convert.ToInt32(rdr["studentNum"]);
                    StudentData.name       = rdr["name"].ToString();
                    StudentData.phone      = rdr["phone"].ToString();
                    Student.Add(Student);
                }
                rdr.Close();
            }
            return(Student);
        }
Example #9
0
        public ArrayList Select_Reader(eItem item, string str)
        {
            stBookData bookData = new stBookData(0, "", "");

            bookList = new ArrayList();

            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string sql = "SELECT * FROM Book WHERE " + item.ToString() + "=" + str + "";

                SQLiteCommand    cmd = new SQLiteCommand(sql, conn);
                SQLiteDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    bookData.author = rdr["author"].ToString();
                    bookData.title  = rdr["title"].ToString();
                    bookList.Add(bookData);
                }
                rdr.Close();
            }
            return(bookList);
        }
Example #10
0
 public ArrayList Select_Reader(eItem item, string str)
 {
     return Load;
 }
Example #11
0
 public int Item_Modificar(int id, string descripcion)
 {
     Item = new eItem();
     Item._id = id;
     Item._descripcion = descripcion;
     Item.Item_Modificar();
     return 1;
 }
Example #12
0
 public DataTable Item_Concepto_Obtener(int ConceptoId)
 {
     Item = new eItem();
     Item._conceptoid = ConceptoId;
     return Item.Item_Conceptos_Obtener();            
 }
Example #13
0
    void SetEquipImg(GameObject obj)
    {
        if (ItemMng.Ins.li_Item.Count == 0)
        {
            return;
        }
        equipStringList = new List <string>();

        //인벤 슬롯을 클릭했을 경우
        for (int i = 0; i < invenItemSlotList.Count; ++i)
        {
            if (obj.gameObject == invenItemSlotList[i].gameObject)
            {
                itemIdx = i;
                break;
            }
        }

        //==>클릭한 이미지의 장비아이템, 장비아이템 타입, 장비아이템 이미지
        eItem eItem = (eItem)Enum.Parse(typeof(eItem), ItemMng.Ins.li_Item[itemIdx]);
        var   type  = eItem.GetItemType();
        var   path  = string.Format(Path.IMG, ItemMng.Ins.li_Item[itemIdx]);
        var   img   = Resources.Load <Sprite>(path) as Sprite;

        //==<

        //체인지할 클릭한 이미지
        sprItem = img;

        //클릭한 아이템과 장비 슬롯에 타입이 같은지
        for (int i = 0; i < equipList.Count; ++i)
        {
            //==>아이템 슬롯에서 클릭한 아이템 타입 찾기
            //var path = string.Format(Path.IMG, ItemMng.Ins.li_Item[itemIdx]);
            //var img  = Resources.Load<Sprite>(path) as Sprite;
            eItemType eType = (eItemType)Enum.Parse(typeof(eItemType), type.eType);
            //==<

            //==>euqip 슬롯에서 같은 타입 찾기
            eItemType eEquipType = (eItemType)Enum.Parse(typeof(eItemType), equipList[i].tag);

            if (eType == eEquipType)
            {
                equipIdx = i;
                break;
            }
        }

        Debug.Log(itemIdx);
        Debug.Log(equipIdx);

        //아이템 착용시 해당 타입의 장비를 착용했는지 체크
        bool flag = false;

        //해당 영웅이 장비를 한번이라도 착용한적있나?
        if (Player.Ins.heroEquipList.ContainsKey(heroIdx))
        {
            //있다면 클릭한 장비의 타입을 착용했나?
            //equip슬롯이 기본이미지라면 해당 타입의 장비는 착용x 아니면 착용
            var sPath = string.Format(Path.IMG, sBasicEquipImg[equipIdx]);
            var temp  = Resources.Load <Sprite>(sPath) as Sprite;

            if (equipList[equipIdx].sprite != temp)
            {
                flag = true;
            }
        }
        else
        {
            //해당 영웅이 장비를 착용한 적이 없음
            EquipImg();

            for (int i = 0; i < equipList.Count; ++i)
            {
                equipStringList.Add(equipList[i].sprite.name);
            }

            Player.Ins.heroEquipList.Add(heroIdx, equipStringList);
            //GameMng.Ins.heroStat.PlusStat(heroIdx, sprItem);

            ItemMng.Ins.RemoveItem(itemIdx);

            ItemSlotSort();
            return;
        }

        if (flag)
        {
            //장비는 한개라도 착용했고 해당 타입의 장비도 착용했다
            //장비스왑
            equipMounting.gameObject.SetActive(true);
            return;
        }
        else
        {
            //장비는 한개라도 착용했고 해당 타입의 장비는 착용하지 않았다.
            EquipImg();

            for (int i = 0; i < equipList.Count; ++i)
            {
                equipStringList.Add(equipList[i].sprite.name);
            }

            Player.Ins.heroEquipList[heroIdx] = equipStringList;
            //GameMng.Ins.heroStat.PlusStat(heroIdx, sprItem);

            ItemMng.Ins.RemoveItem(itemIdx);
        }

        ItemSlotSort();
    }
Example #14
0
        public DataSet GetData(eItem item, string str)
        {
            DataSet db = new DataSet();

            return(db);
        }
Example #15
0
 private void toolStripButtonDrawRectangle_Click(object sender, EventArgs e)
 {
     m_CurrentItem = eItem.Rectangle;
 }
Example #16
0
 private void toolStripButtonEllipse_Click(object sender, EventArgs e)
 {
     m_CurrentItem = eItem.Ellipse;
 }
Example #17
0
 private void toolStripButtonDrawLine_Click(object sender, EventArgs e)
 {
     m_CurrentItem = eItem.Line;
 }
Example #18
0
 public DataSet GetData(eItem item, string str)
 {
     DataSet db = new DataSet();
     return db;
 }
Example #19
0
 public static ItemData GetItemType(this eItem eItem)
 {
     return(TableMng.Ins.GetValue <int, ItemData>(eTable.Item, (int)eItem));
 }
Example #20
0
        public void Producto_Almacenar(string nombre, List<int> instrumentos)
        {
            // crear Item
            Item = new eItem();
            Item._conceptoid = 56;
            Item._descripcion = nombre;
            int indice = Item.Item_Almacenar();

            // crear productos (asociacion item <---> Instrumentos)
            if (indice != -1)
            {
                Producto = new eProducto();
                Producto.ItemId = indice;
                Producto.Instrumentos = instrumentos;
                Producto.Nombre = nombre;
                Producto.Producto_Almacenar();
            }
            else 
            { 
                // eliminar item 
            }
        }
Example #21
0
        public DataSet Producto_Obtiene_Tablas()
        {
            DataSet ds = new DataSet();
            eGrupoInstrumento grupo = new eGrupoInstrumento();
            eInstrumento instrumento = new eInstrumento();            
            Item = new eItem(3);

            ds.Tables.Add(grupo.GrupoInstrumento_Obtiene()); // validar
            ds.Tables.Add(instrumento.Instrumento_Obtiene());
            ds.Tables.Add(Item.Item_Obtener_Productos());
            
            return ds;
        }
Example #22
0
 private void toolStripButtonDrawPencil_Click(object sender, EventArgs e)
 {
     m_CurrentItem = eItem.Pencil;
 }
Example #23
0
 public Item GetItem(eItem item)
 {
     return(m_listItems[(int)item]);
 }
Example #24
0
 private void toolStripButtonDrawSmiley_Click(object sender, EventArgs e)
 {
     m_CurrentItem = eItem.Smiley;
 }
Example #25
0
    void Start()
    {
        weaponControl = GameManager.instance.player.GetComponent<PlayerWeaponController>();
        spriteRenderer = GetComponent<SpriteRenderer>();
        int randomNumber = Random.Range(0, 100);

        // deciding on the item
        item = getItem(randomNumber);

        // rendering the item
        renderItem(item);

        //setLayers();
        int layerNum = decideLayer(transform.position.y);
        gameObject.GetComponent<SpriteRenderer>().sortingLayerName = Utilities.SortingLayerNames[layerNum];

        // An animation of the item falling on the ground
        iTween.MoveBy(gameObject, iTween.Hash("y", -0.3f, "time", 0.5f, "easeType", "easeInOutSine"));
        // An animation of the item flying to the HUD
        SendItemToHud();
    }
Example #26
0
 private void toolStripButtonEraser_Click(object sender, EventArgs e)
 {
     m_CurrentItem = eItem.Eraser;
 }
Example #27
0
 public DataTable Item_Concepto_Obtener(int ConceptoId)
 {
     Item             = new eItem();
     Item._conceptoid = ConceptoId;
     return(Item.Item_Conceptos_Obtener());
 }
Example #28
0
 public Item GetItem(eItem idx)
 {
     return(m_listItemList[(int)idx]);
 }
Example #29
0
        public ArrayList Select_Reader(eItem item, string str)
        {
            stBookData bookData = new stBookData(0, "", "");
            bookList = new ArrayList();

            using (var conn = new SQLiteConnection(connStr))
            {
                conn.Open();
                string sql = "SELECT * FROM Book WHERE " + item.ToString() + "=" + str + "";

                SQLiteCommand cmd = new SQLiteCommand(sql, conn);
                SQLiteDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    bookData.author = rdr["author"].ToString();
                    bookData.title = rdr["title"].ToString();
                    bookList.Add(bookData);
                }
                rdr.Close();
            }
            return bookList;
        }
Example #30
0
 private void renderItem(eItem item)
 {
     switch (item)
     {
         case eItem.Pistol:
             spriteRenderer.sprite = ammoSprites[0];
             gameObject.transform.localScale = new Vector3(transform.localScale.x * 0.2f, transform.localScale.y * 0.2f, 0);
             break;
         case eItem.Shotgun:
             spriteRenderer.sprite = ammoSprites[1];
             gameObject.transform.localScale = new Vector3(transform.localScale.x * 0.2f, transform.localScale.y * 0.2f, 0);
             break;
         case eItem.Bazooka:
             spriteRenderer.sprite = ammoSprites[2];
             gameObject.transform.localScale = new Vector3(transform.localScale.x * 0.2f, transform.localScale.y * 0.2f, 0);
             break;
         default:
             spriteRenderer.sprite = ammoSprites[3];
             gameObject.transform.localScale = new Vector3(transform.localScale.x * 0.4f, transform.localScale.y * 0.4f, 0);
             break;
     }
 }
Example #31
0
 public ArrayList Select_Reader(eItem item, string str)
 {
     return(Load);
 }