Пример #1
0
        public Stable FindEmptyStable()
        {
            Stable result = Stables.FirstOrDefault(stable => stable.StableHorse == null);

            if (result == null)
            {
                NoEmptyStableFound(this, new EventArgs());
            }
            return(result);
        }
Пример #2
0
 public void Initialize()
 {
     if (myInitialized)
     {
         return;
     }
     try
     {
         BHI = new Dictionary <int, List <BidHouseItem> >();
         if (!BidHouseTable.BHITEMS.ContainsKey(this.Guid))
         {
             BidHouseTable.BHITEMS.Add(Guid, new Dictionary <int, List <BidHouseItem> >());
         }
         BHI = BidHouseTable.BHITEMS[Guid];
         foreach (String s in Friends.Split(';'))
         {
             if (String.IsNullOrEmpty(s))
             {
                 continue;
             }
             FriendsList.Add(Convert.ToInt32(s.Split('|')[0]), s.Split('|')[1]);
         }
         foreach (String s in Ennemys.Split(';'))
         {
             if (String.IsNullOrEmpty(s))
             {
                 continue;
             }
             EnnemyList.Add(Convert.ToInt32(s.Split('|')[0]), s.Split('|')[1]);
         }
         foreach (String s in Bank.Split(';'))
         {
             if (String.IsNullOrEmpty(s))
             {
                 continue;
             }
             long id;
             if (!long.TryParse(s, out id))
             {
                 continue;
             }
             InventoryItemModel obj = InventoryItemTable.getItem(id);
             if (obj != null)
             {
                 bankItems.Add(id, obj);
             }
             else
             {
                 obj = InventoryItemTable.Load(id);
                 if (obj != null)
                 {
                     bankItems.Add(id, obj);
                 }
             }
         }
         foreach (String s in Stables.Split(';'))
         {
             if (String.IsNullOrEmpty(s))
             {
                 continue;
             }
             int id;
             if (!int.TryParse(s, out id))
             {
                 continue;
             }
             Mount DD = MountTable.getMount(id);
             if (DD != null)
             {
                 Mounts.Add(id, DD);
             }
         }
     }
     catch (Exception e)
     {
         Logger.Error(e);
     }
     myInitialized = true;
 }