Ejemplo n.º 1
0
    public void SaveItem(ItemData itemData)
    {
        //Set Item Name
        itemData.Name = NameField.text;

        //Set Item Description
        itemData.Description = DescriptionField.text;

        //Set Item Value
        itemData.Value = int.Parse(ValueField.text);

        //Set Item Sprite URI
        itemData.SpriteURI = SpriteURIField.text;

        switch (TypeField.value)
        {
        case 0:
            itemData.Type = ItemData.ItemType.Valuable;
            break;

        case 1:
            itemData.Type = ItemData.ItemType.Quest;
            break;

        case 2:
            itemData.Type = ItemData.ItemType.KeyItem;
            break;

        default:
            Debug.LogError("Unknown Item Type.");
            break;
        }


        if (DataMart.CheckItemDataBase(itemData.ID))
        {
            DataMart.RemoveItem(itemData);
        }
        DataMart.AddItem(itemData);
        SaveButton.GetComponent <Image>().color = Color.green;
    }
Ejemplo n.º 2
0
        public static void BuildItemDatabase()
        {
            //Clear the item database to start fresh.
            DataMart.ClearItemDatabase();

            ItemData data = new ItemData(
                0,
                "Two of Clubs",
                "A low value card of clubs, usually sold for easy money.",
                25,
                "Icons/Card/2clubs", ItemData.ItemType.Valuable);

            DataMart.AddItem(data);


            data = new ItemData(
                1,
                "Two of Diamonds",
                "A low value card of diamonds, usually sold for easy money.",
                25,
                "Icons/Card/2diamonds", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                2,
                "Two of Hearts",
                "A low value card of hearts, usually sold for easy money.",
                25,
                "Icons/Card/2hearts", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                3,
                "Two of Spades",
                "A low value card of spades, usually sold for easy money.",
                25,
                "Icons/Card/2spades", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                4,
                "Three of Clubs",
                "A low value card of clubs, usually sold for easy money.",
                50,
                "Icons/Card/3clubs", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);


            data = new ItemData(
                5,
                "Three of Diamonds",
                "A low value card of diamonds, usually sold for easy money.",
                50,
                "Icons/Card/3diamonds", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                6,
                "Three of Hearts",
                "A low value card of hearts, usually sold for easy money.",
                50,
                "Icons/Card/3hearts", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                7,
                "Three of Spades",
                "A low value card of spades, usually sold for easy money.",
                50,
                "Icons/Card/3spades", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                8,
                "Four of Clubs",
                "A low value card of clubs, usually sold for easy money.",
                100,
                "Icons/Card/4clubs", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);


            data = new ItemData(
                9,
                "Four of Diamonds",
                "A low value card of diamonds, usually sold for easy money.",
                100,
                "Icons/Card/4diamonds", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                10,
                "Four of Hearts",
                "A low value card of hearts, usually sold for easy money.",
                100,
                "Icons/Card/4hearts", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                11,
                "Four of Spades",
                "A low value card of spades, usually sold for easy money.",
                100,
                "Icons/Card/4spades", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                12,
                "Five of Clubs",
                "A low value card of clubs, usually sold for easy money.",
                150,
                "Icons/Card/5clubs", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);


            data = new ItemData(
                13,
                "Five of Diamonds",
                "A low value card of diamonds, usually sold for easy money.",
                150,
                "Icons/Card/5diamonds", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                14,
                "Five of Hearts",
                "A low value card of hearts, usually sold for easy money.",
                150,
                "Icons/Card/5hearts", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                15,
                "Five of Spades",
                "A low value card of spades, usually sold for easy money.",
                150,
                "Icons/Card/5spades", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                16,
                "Six of Clubs",
                "A moderate value card of clubs, usually sold for pretty good money.",
                500,
                "Icons/Card/6clubs", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);


            data = new ItemData(
                17,
                "Six of Diamonds",
                "A moderate value card of diamonds, usually sold for pretty good money.",
                500,
                "Icons/Card/6diamonds", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                18,
                "Six of Hearts",
                "A moderate value card of hearts, usually sold for pretty good money.",
                500,
                "Icons/Card/6hearts", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                19,
                "Six of Spades",
                "A moderate value card of spades, usually sold for pretty good money.",
                500,
                "Icons/Card/6spades", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                20,
                "Seven of Clubs",
                "A moderate value card of clubs, usually sold for pretty good money.",
                600,
                "Icons/Card/7clubs", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                21,
                "Seven of Diamonds",
                "A moderate value card of diamonds, usually sold for pretty good money.",
                600,
                "Icons/Card/7diamonds", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                22,
                "Seven of Hearts",
                "A moderate value card of hearts, usually sold for pretty good money.",
                600,
                "Icons/Card/7hearts", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                23,
                "Seven of Spades",
                "A moderate value card of spades, usually sold for pretty good money.",
                600,
                "Icons/Card/7spades", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                24,
                "Eight of Clubs",
                "A moderate value card of clubs, usually sold for pretty good money.",
                750,
                "Icons/Card/8clubs", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                25,
                "Eight of Diamonds",
                "A moderate value card of diamonds, usually sold for pretty good money.",
                750,
                "Icons/Card/8diamonds", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                26,
                "Eight of Hearts",
                "A moderate value card of hearts, usually sold for pretty good money.",
                750,
                "Icons/Card/8hearts", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                27,
                "Eight of Spades",
                "A moderate value card of spades, usually sold for pretty good money.",
                750,
                "Icons/Card/8spades", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                28,
                "Nine of Clubs",
                "A moderate value card of clubs, usually sold for pretty good money.",
                850,
                "Icons/Card/9clubs", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                29,
                "Nine of Diamonds",
                "A moderate value card of diamonds, usually sold for pretty good money.",
                850,
                "Icons/Card/9diamonds", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                30,
                "Nine of Hearts",
                "A moderate value card of hearts, usually sold for pretty good money.",
                850,
                "Icons/Card/9hearts", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                31,
                "Nine of Spades",
                "A moderate value card of spades, usually sold for pretty good money.",
                850,
                "Icons/Card/9spades", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                32,
                "Ten of Clubs",
                "A moderate value card of clubs, usually sold for pretty good money.",
                1000,
                "Icons/Card/10clubs", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                33,
                "Ten of Diamonds",
                "A moderate value card of diamonds, usually sold for pretty good money.",
                1000,
                "Icons/Card/10diamonds", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                34,
                "Ten of Hearts",
                "A moderate value card of hearts, usually sold for pretty good money.",
                1000,
                "Icons/Card/10hearts", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                35,
                "Ten of Spades",
                "A moderate value card of spades, usually sold for pretty good money.",
                1000,
                "Icons/Card/10spades", ItemData.ItemType.Valuable);
            DataMart.AddItem(data);

            data = new ItemData(
                36,
                "Jack of Clubs",
                "A high value card of clubs that is worth a small fortune. Having one in your possession allows you to go places.",
                1500,
                "Icons/Card/jackclubs", ItemData.ItemType.KeyItem);
            DataMart.AddItem(data);

            data = new ItemData(
                37,
                "Jack of Diamonds",
                "A high value card of diamonds that is worth a small fortune. Having one in your possession allows you to go places.",
                1500,
                "Icons/Card/jackdiamonds", ItemData.ItemType.KeyItem);
            DataMart.AddItem(data);

            data = new ItemData(
                38,
                "Jack of Hearts",
                "A high value card of hearts that is worth a small fortune. Having one in your possession allows you to go places.",
                1500,
                "Icons/Card/jackhearts", ItemData.ItemType.KeyItem);
            DataMart.AddItem(data);

            data = new ItemData(
                39,
                "Jack of Spades",
                "A high value card of spades that is worth a small fortune. Having one in your possession allows you to go places.",
                1500,
                "Icons/Card/jackspades", ItemData.ItemType.KeyItem);
            DataMart.AddItem(data);

            data = new ItemData(
                40,
                "Queen of Clubs",
                "A high value card of clubs that is worth a small fortune. Having one in your possession allows you to go places.",
                2000,
                "Icons/Card/queenclubs", ItemData.ItemType.KeyItem);
            DataMart.AddItem(data);

            data = new ItemData(
                41,
                "Queen of Diamonds",
                "A high value card of diamonds that is worth a small fortune. Having one in your possession allows you to go places.",
                2000,
                "Icons/Card/queendiamonds", ItemData.ItemType.KeyItem);
            DataMart.AddItem(data);

            data = new ItemData(
                42,
                "Queen of Hearts",
                "A high value card of hearts that is worth a small fortune. Having one in your possession allows you to go places.",
                2000,
                "Icons/Card/queenhearts", ItemData.ItemType.KeyItem);
            DataMart.AddItem(data);

            data = new ItemData(
                43,
                "Queen of Spades",
                "A high value card of spades that is worth a small fortune. Having one in your possession allows you to go places.",
                2000,
                "Icons/Card/queenspades", ItemData.ItemType.KeyItem);
            DataMart.AddItem(data);

            data = new ItemData(
                44,
                "King of Clubs",
                "A high value card of clubs that is worth a small fortune. Having one in your possession allows you to go places.",
                3000,
                "Icons/Card/kingclubs", ItemData.ItemType.Quest);
            DataMart.AddItem(data);

            data = new ItemData(
                45,
                "King of Diamonds",
                "A high value card of diamonds that is worth a small fortune. Having one in your possession allows you to go places.",
                3000,
                "Icons/Card/kingdiamonds", ItemData.ItemType.Quest);
            DataMart.AddItem(data);

            data = new ItemData(
                46,
                "King of Hearts",
                "A high value card of hearts that is worth a small fortune. Having one in your possession allows you to go places.",
                3000,
                "Icons/Card/kinghearts", ItemData.ItemType.Quest);
            DataMart.AddItem(data);

            data = new ItemData(
                47,
                "King of Spades",
                "A high value card of spades that is worth a small fortune. Having one in your possession allows you to go places.",
                3000,
                "Icons/Card/kingspades", ItemData.ItemType.Quest);
            DataMart.AddItem(data);

            data = new ItemData(
                48,
                "Ace of Clubs",
                "Merchants see no value in this card of clubs..it must be good for something.",
                0,
                "Icons/Card/aceclubs", ItemData.ItemType.Quest);
            DataMart.AddItem(data);

            data = new ItemData(
                49,
                "Ave of Diamonds",
                "Merchants see no value in this card of diamonds..it must be good for something.",
                0,
                "Icons/Card/acediamonds", ItemData.ItemType.Quest);
            DataMart.AddItem(data);

            data = new ItemData(
                50,
                "Ace of Hearts",
                "Merchants see no value in this card of hearts..it must be good for something.",
                0,
                "Icons/Card/acehearts", ItemData.ItemType.Quest);
            DataMart.AddItem(data);

            data = new ItemData(
                51,
                "Ace of Spades",
                "Merchants see no value in this card of spades..it must be good for something.",
                0,
                "Icons/Card/acespades", ItemData.ItemType.Quest);
            DataMart.AddItem(data);
        }