Exemple #1
0
        public void OpenSafe(Safe safe, Owner owner)
        {
            safe.PickLock(this);
            Jewels safeContents = safe.Open(_writtenDownCombination);

            ReturnContents(safeContents, owner);
        }
Exemple #2
0
    public virtual void Restart()
    {
      var childJewels = GetComponentsInChildren<IUiJewel>();
      foreach (var uiJewelPile in childJewels)
        UiJewelPool.Instance.ReleasePooledObject(uiJewelPile.gameObject);

      Jewels.Clear();
    }
Exemple #3
0
 public static bool IsJewel(string itemBase)
 {
     if (Jewels.Contains(itemBase))
     {
         return(true);
     }
     return(false);
 }
Exemple #4
0
    /// <summary>
    ///     Remove a card from the pile.
    /// </summary>
    /// <param name="card"></param>
    public virtual void RemoveJewel(IUiJewel jewel)
    {
      if (jewel == null)
        throw new ArgumentNullException("Null is not a valid argument.");

      Jewels.Remove(jewel);

      NotifyPileChange();
    }
Exemple #5
0
    //--------------------------------------------------------------------------------------------------------------

    #region Operations

    /// <summary>
    ///     Add a card to the pile.
    /// </summary>
    /// <param name="card"></param>
    public virtual void AddJewel(IUiJewel jewel)
    {
      if (jewel == null)
        throw new ArgumentNullException("Null is not a valid argument.");

      Jewels.Add(jewel);
      jewel.transform.SetParent(transform);
      //Debug.Log("AddJewel");
      //jewel.Renderer.sprite = jewel.Data.Artwork;
      jewel.Initialize();
      NotifyPileChange();
      jewel.Draw();
    }
Exemple #6
0
        public DataContext()
        {
            for (uint i = 0; i < 256; i++)
            {
                BattleItems.Add(new Item(0x37590 + i * 8));
            }

            for (uint i = 0; i < 1024; i++)
            {
                OtherItems.Add(new Item(0x37D90 + i * 8));
            }

            for (uint i = 0; i < 200; i++)
            {
                Charactors.Add(new Charactor(0x700 + i * 1062));
            }

            for (uint i = 0; i < 120; i++)
            {
                Jewels.Add(new Jewel(0x46380 + i * 8));
            }

            for (uint i = 0; i < 12; i++)
            {
                Party.Add(new Member(0x6D0 + i * 4));
            }

            foreach (var info in Info.Instance().Places)
            {
                Places.Add(new Place(info));
            }

            foreach (var info in Info.Instance().Minds)
            {
                Minds.Add(new MindQuest(info));
            }

            foreach (var info in Info.Instance().Medals)
            {
                Medals.Add(new Medal(info));
            }
        }
        private void FillGrid(int StartRow)
        {
            //var owner = (frmCatalogue)Owner;
            //var Jewels = _jewelService.GetCatalogueJewels(owner.FromJewel, owner.ToJewel, owner.JewelDescription, owner.SelectedWeight);

            IList <JewelMaster> Jewels;

            Jewels = OWNERS.HasFilters ? _jewelService.GetCatalogueJewels(OWNERS.Filters) : _jewelService.GetCatalogueJewels(OWNERS.FromJewel, OWNERS.ToJewel, OWNERS.JewelDescription, OWNERS.SelectedWeight);

            totalRecords = Jewels.Count;
            if (totalRecords == 0)
            {
                MessageBox.Show(Resources.frmProduct_FillGrid_Records_Not_found__);
                Close();
                return;
            }
            var JewelData = Jewels.Skip(StartRow).Take(10).ToList();

            dgvJewel.Rows.Clear();
            GridRow = 0;

            foreach (var jewel in JewelData)
            {
                dgvJewel.Rows.Add(1);
                dgvJewel.Rows[GridRow].Height          = 100;
                dgvJewel.Rows[GridRow].Cells[2].Value  = jewel.JewelNo;
                dgvJewel.Rows[GridRow].Cells[3].Value  = jewel.StyleNo;
                dgvJewel.Rows[GridRow].Cells[4].Value  = jewel.JewelDescription;
                dgvJewel.Rows[GridRow].Cells[5].Value  = jewel.MetalColor;
                dgvJewel.Rows[GridRow].Cells[6].Value  = ImageExtension.GetImageName(jewel.StyleNo);
                dgvJewel.Rows[GridRow].Cells[7].Value  = jewel.DiamondPcs;
                dgvJewel.Rows[GridRow].Cells[8].Value  = jewel.DiamondWt;
                dgvJewel.Rows[GridRow].Cells[9].Value  = jewel.GrsWt;
                dgvJewel.Rows[GridRow].Cells[10].Value = jewel.NetWt;
                dgvJewel[1, GridRow].Value             = ImageExtension.ResolveImage(jewel.StyleNo);

                GridRow = GridRow + 1;
            }

            lblTotItems.Text = Resources.frmProduct_FillGrid_ + Convert.ToString(dgvJewel.RowCount);
            dgvJewel.Focus();
        }
        public DecorationsOverrideViewModel(IList <IJewel> jewels, Func <IList <DecorationsSaveSlotInfo>, DecorationsSaveSlotInfo> saveSlotInfoSelector)
        {
            this.saveSlotInfoSelector = saveSlotInfoSelector;

            Jewels = jewels
                     .Select(x => new JewelOverrideViewModel(this, x, 0))
                     .ToList();

            Dictionary <string, DecorationOverrideConfigurationItem> decorationOverrides = GlobalData.Instance.Configuration.InParameters?.DecorationOverride?.Items;

            CancelCommand             = new AnonymousCommand(OnCancel);
            OpenIntegratedHelpCommand = new AnonymousCommand(OnOpenIntegratedHelp);
            ImportCommand             = new AnonymousCommand(OnImport);

            if (decorationOverrides != null)
            {
                isLoadingConfiguration = true;

                try
                {
                    foreach (KeyValuePair <string, DecorationOverrideConfigurationItem> decoOverride in decorationOverrides)
                    {
                        JewelOverrideViewModel vm = Jewels.FirstOrDefault(x => Core.Localization.GetDefault(x.Name) == decoOverride.Key);
                        if (vm != null)
                        {
                            vm.IsOverriding = decoOverride.Value.IsOverriding;
                            vm.Count        = decoOverride.Value.Count;
                        }
                    }
                }
                finally
                {
                    isLoadingConfiguration = false;
                }
            }
        }
Exemple #9
0
        public List <Node> nextNode()
        {
            List <Node> listNode = new List <Node>();

            foreach (EnumIA.Action action in actionsAvailable())
            {
                switch (action)
                {
                case EnumIA.Action.bas:
                    List <EnumIA.Action> tempBas = new List <EnumIA.Action>();
                    tempBas.AddRange(this.actions);
                    tempBas.Add(EnumIA.Action.bas);
                    listNode.Add(new Node(posAgent.move(EnumIA.Action.bas), Jewels, Dust,
                                          tempBas, calculHeuristic(action), this, null));
                    break;

                case EnumIA.Action.haut:
                    List <EnumIA.Action> tempHaut = new List <EnumIA.Action>();
                    tempHaut.AddRange(this.actions);
                    tempHaut.Add(EnumIA.Action.haut);
                    listNode.Add(new Node(posAgent.move(EnumIA.Action.haut), Jewels, Dust,
                                          tempHaut, calculHeuristic(action), this, null));
                    break;

                case EnumIA.Action.droite:
                    List <EnumIA.Action> tempDroite = new List <EnumIA.Action>();
                    tempDroite.AddRange(this.actions);
                    tempDroite.Add(EnumIA.Action.droite);
                    listNode.Add(new Node(posAgent.move(EnumIA.Action.droite), Jewels, Dust,
                                          tempDroite, calculHeuristic(action), this, null));

                    break;

                case EnumIA.Action.gauche:
                    List <EnumIA.Action> tempGauche = new List <EnumIA.Action>();
                    tempGauche.AddRange(this.actions);
                    tempGauche.Add(EnumIA.Action.gauche);
                    listNode.Add(new Node(posAgent.move(EnumIA.Action.gauche), Jewels, Dust,
                                          tempGauche, calculHeuristic(action), this, null));
                    break;

                case EnumIA.Action.aspirer:
                    Dust.Remove(posAgent);
                    List <EnumIA.Action> tempAspirer = new List <EnumIA.Action>();
                    tempAspirer.AddRange(this.actions);
                    tempAspirer.Add(EnumIA.Action.aspirer);
                    listNode.Add(new Node(posAgent, Jewels, posAgent.remove(Dust),
                                          tempAspirer, calculHeuristic(action), this, null));
                    break;

                case EnumIA.Action.recuperer:
                    Jewels.Remove(posAgent);
                    List <EnumIA.Action> tempRecuperer = new List <EnumIA.Action>();
                    tempRecuperer.AddRange(this.actions);
                    tempRecuperer.Add(EnumIA.Action.recuperer);
                    listNode.Add(new Node(posAgent, posAgent.remove(Jewels), Dust,
                                          tempRecuperer, calculHeuristic(action), this, null));
                    break;
                }
            }

            return(listNode);
        }
Exemple #10
0
 public void ReturnContents(Jewels safeContents, Owner owner)
 {
     owner.RecievedContents(safeContents);
 }
Exemple #11
0
 /// <summary>
 /// 类型:方法
 /// 名称:CancelEquipments
 /// 作者:taixihuase
 /// 作用:禁用装备属性
 /// 编写日期:2015/8/20
 /// </summary>
 public void CancelEquipments()
 {
     Armors.Cancel(this);
     Jewels.Cancel(this);
     Weapons.Cancel(this);
 }
Exemple #12
0
 /// <summary>
 /// 类型:方法
 /// 名称:ApplyEquipments
 /// 作者:taixihuase
 /// 作用:启用装备属性
 /// 编写日期:2015/8/20
 /// </summary>
 public void ApplyEquipments()
 {
     Armors.Apply(this);
     Jewels.Apply(this);
     Weapons.Apply(this);
 }
Exemple #13
0
 public void Awake()
 {
     jewels = (Jewels)target;
 }
Exemple #14
0
 public void NotifyPileChange()
 {
   OnPileChanged?.Invoke(Jewels.ToArray());
 }
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Player")
        {
            //check for each item available and add.
            //itemtype references the item array found under the inventoryScript
            //gameobject.
            //check if full so we can add the items
            if (InventoryScript.MyInstance.MyEmptySlotCount > 0)
            {
                if (itemType == "Leaflet")
                {
                    Leaflet leaflet = (Leaflet)Instantiate(InventoryScript.MyInstance.items[1]);
                    InventoryScript.MyInstance.AddItem(leaflet);
                }
                else if (itemType == "Egg")
                {
                    Egg egg = (Egg)Instantiate(InventoryScript.MyInstance.items[2]);
                    InventoryScript.MyInstance.AddItem(egg);
                }
                else if (itemType == "Sword")
                {
                    Sword sword = (Sword)Instantiate(InventoryScript.MyInstance.items[3]);
                    InventoryScript.MyInstance.AddItem(sword);
                }
                else if (itemType == "Trident")
                {
                    Trident trident = (Trident)Instantiate(InventoryScript.MyInstance.items[4]);
                    InventoryScript.MyInstance.AddItem(trident);
                }
                else if (itemType == "Airpump")
                {
                    AirPump ap = (AirPump)Instantiate(InventoryScript.MyInstance.items[5]);
                    InventoryScript.MyInstance.AddItem(ap);
                }
                else if (itemType == "Bar")
                {
                    PlatinumBar bar = (PlatinumBar)Instantiate(InventoryScript.MyInstance.items[6]);
                    InventoryScript.MyInstance.AddItem(bar);
                }
                else if (itemType == "Knife")
                {
                    Knife knife = (Knife)Instantiate(InventoryScript.MyInstance.items[7]);
                    InventoryScript.MyInstance.AddItem(knife);
                }
                else if (itemType == "Rope")
                {
                    Rope rope = (Rope)Instantiate(InventoryScript.MyInstance.items[8]);
                    InventoryScript.MyInstance.AddItem(rope);
                }
                else if (itemType == "Skull")
                {
                    Skull skull = (Skull)Instantiate(InventoryScript.MyInstance.items[9]);
                    InventoryScript.MyInstance.AddItem(skull);
                }
                else if (itemType == "Sack")
                {
                    Sack sack = (Sack)Instantiate(InventoryScript.MyInstance.items[10]);
                    InventoryScript.MyInstance.AddItem(sack);
                }
                else if (itemType == "Lantern")
                {
                    Lantern lantern = (Lantern)Instantiate(InventoryScript.MyInstance.items[11]);
                    InventoryScript.MyInstance.AddItem(lantern);
                }
                else if (itemType == "Bottle")
                {
                    Bottle bottle = (Bottle)Instantiate(InventoryScript.MyInstance.items[12]);
                    InventoryScript.MyInstance.AddItem(bottle);
                }
                else if (itemType == "Candle")
                {
                    Candle candle = (Candle)Instantiate(InventoryScript.MyInstance.items[13]);
                    InventoryScript.MyInstance.AddItem(candle);
                }
                else if (itemType == "BlackBook")
                {
                    BlkBook book = (BlkBook)Instantiate(InventoryScript.MyInstance.items[14]);
                    InventoryScript.MyInstance.AddItem(book);
                }
                else if (itemType == "PlasticPile")
                {
                    PlasticPile plastic = (PlasticPile)Instantiate(InventoryScript.MyInstance.items[15]);
                    InventoryScript.MyInstance.AddItem(plastic);
                }
                else if (itemType == "Buoy")
                {
                    Buoy buoy = (Buoy)Instantiate(InventoryScript.MyInstance.items[16]);
                    InventoryScript.MyInstance.AddItem(buoy);
                }
                else if (itemType == "Shovel")
                {
                    Shovel shovel = (Shovel)Instantiate(InventoryScript.MyInstance.items[17]);
                    InventoryScript.MyInstance.AddItem(shovel);
                }
                else if (itemType == "Scarab")
                {
                    Scarab scarab = (Scarab)Instantiate(InventoryScript.MyInstance.items[18]);
                    InventoryScript.MyInstance.AddItem(scarab);
                }
                else if (itemType == "PotOfGold")
                {
                    PotOfGold gold = (PotOfGold)Instantiate(InventoryScript.MyInstance.items[19]);
                    InventoryScript.MyInstance.AddItem(gold);
                }
                else if (itemType == "Bracelet")
                {
                    Bracelet bracelet = (Bracelet)Instantiate(InventoryScript.MyInstance.items[20]);
                    InventoryScript.MyInstance.AddItem(bracelet);
                }
                else if (itemType == "Coal")
                {
                    Coal coal = (Coal)Instantiate(InventoryScript.MyInstance.items[21]);
                    InventoryScript.MyInstance.AddItem(coal);
                }
                else if (itemType == "Figurine")
                {
                    Figurine fig = (Figurine)Instantiate(InventoryScript.MyInstance.items[22]);
                    InventoryScript.MyInstance.AddItem(fig);
                }
                else if (itemType == "Diamond")
                {
                    Diamond diamond = (Diamond)Instantiate(InventoryScript.MyInstance.items[23]);
                    InventoryScript.MyInstance.AddItem(diamond);
                }
                else if (itemType == "Torch")
                {
                    Torch torch = (Torch)Instantiate(InventoryScript.MyInstance.items[24]);
                    InventoryScript.MyInstance.AddItem(torch);
                }
                else if (itemType == "Coins")
                {
                    Coins coins = (Coins)Instantiate(InventoryScript.MyInstance.items[25]);
                    InventoryScript.MyInstance.AddItem(coins);
                }
                else if (itemType == "Key")
                {
                    Key key = (Key)Instantiate(InventoryScript.MyInstance.items[26]);
                    InventoryScript.MyInstance.AddItem(key);
                }
                else if (itemType == "Matches")
                {
                    Matches matches = (Matches)Instantiate(InventoryScript.MyInstance.items[27]);
                    InventoryScript.MyInstance.AddItem(matches);
                }
                else if (itemType == "Wrench")
                {
                    Wrench wrench = (Wrench)Instantiate(InventoryScript.MyInstance.items[28]);
                    InventoryScript.MyInstance.AddItem(wrench);
                }
                else if (itemType == "Screwdriver")
                {
                    Screwdriver sd = (Screwdriver)Instantiate(InventoryScript.MyInstance.items[29]);
                    InventoryScript.MyInstance.AddItem(sd);
                }
                else if (itemType == "Jewels")
                {
                    Jewels jewels = (Jewels)Instantiate(InventoryScript.MyInstance.items[30]);
                    InventoryScript.MyInstance.AddItem(jewels);
                }
                else if (itemType == "Coffin")
                {
                    Coffin coffin = (Coffin)Instantiate(InventoryScript.MyInstance.items[31]);
                    InventoryScript.MyInstance.AddItem(coffin);
                }
                else if (itemType == "Chalice")
                {
                    Chalice chalice = (Chalice)Instantiate(InventoryScript.MyInstance.items[32]);
                    InventoryScript.MyInstance.AddItem(chalice);
                }
                //the following items should not be displayed in the world
                //but going to add just in case we revamp how these items
                //are obtained.
                else if(itemType == "Garlic")
                {
                    Garlic garlic = (Garlic)Instantiate(InventoryScript.MyInstance.items[33]);
                    InventoryScript.MyInstance.AddItem(garlic);
                }
                else if(itemType == "Sceptre")
                {
                    Sceptre sep = (Sceptre)Instantiate(InventoryScript.MyInstance.items[34]);
                    InventoryScript.MyInstance.AddItem(sep);
                }






                
                Destroy(gameObject);
            }
            //probably want to utilize CLI popup here
            else
            {
                Debug.Log("Bag full");
            }
        }
        
    }
Exemple #16
0
        public static string GetItemType(string itemBase)
        {
            if (Bows.Contains(itemBase))
            {
                return("Bow");
            }
            if (Claws.Contains(itemBase))
            {
                return("Claw");
            }
            if (OneHandedAxes.Contains(itemBase))
            {
                return("One Hand Axe");
            }
            if (OneHandedMaces.Contains(itemBase))
            {
                return("One Hand Mace");
            }
            if (OneHandedSwords.Contains(itemBase))
            {
                return("One Hand Sword");
            }
            if (TwoHandedAxes.Contains(itemBase))
            {
                return("Two Hand Axe");
            }
            if (TwoHandedMaces.Contains(itemBase))
            {
                return("Two Hand Mace");
            }
            if (Sceptres.Contains(itemBase))
            {
                return("Sceptre");
            }
            if (Daggers.Contains(itemBase))
            {
                return("Dagger");
            }
            if (Staves.Contains(itemBase))
            {
                return("Staff");
            }
            if (Belts.Contains(itemBase))
            {
                return("Belt");
            }
            if (Amulets.Contains(itemBase))
            {
                return("Amulet");
            }
            if (Rings.Contains(itemBase))
            {
                return("Ring");
            }
            if (Boots.Contains(itemBase))
            {
                return("Boots");
            }
            if (Gloves.Contains(itemBase))
            {
                return("Gloves");
            }
            if (BodyArmors.Contains(itemBase))
            {
                return("Body Armour");
            }
            if (Wands.Contains(itemBase))
            {
                return("Wand");
            }
            if (Helmets.Contains(itemBase))
            {
                return("Helmet");
            }
            if (Shields.Contains(itemBase))
            {
                return("Shield");
            }
            if (Jewels.Contains(itemBase))
            {
                return("Jewel");
            }
            if (itemBase == "Gem")
            {
                return(itemBase);
            }
            if (Quivers.Contains(itemBase))
            {
                return("Quiver");
            }

            return("No type found");
        }
Exemple #17
0
 public virtual void ReturnContents(Jewels safeContents, Owner owner)
 {
     owner.ReceiveContents(safeContents);
 }