public MapInformation(Guid mapId, string str = null) { IsMapMoved = false; MapId = mapId; if (str != null) { str = HttpUtility.UrlDecode(str); var items = str.Split(';'); foreach (var pair in items) { string[] keyValuePair = pair.Split('='); if (keyValuePair.Length == 2 && !string.IsNullOrWhiteSpace(keyValuePair[1])) { CookieItem.Add(keyValuePair[0], keyValuePair[1]); } } } }
public void SetCookiesOnRack(Item _item, int _amount, LocationTypes _location, float _currentRotTime, float _currentRotRate) { CookieItem cookieItem = GetComponentInChildren <CookieItem>(); cookieItem.CovertToCookieType(_item); if (cookieItem) { LocationTypes location = _location; float currentRotTime = _currentRotTime; float currentRotRate = _currentRotRate; Item item = new Item(cookieItem.product); for (int i = 0; i < cookieInventory.GetSlots.Length; i++) { if (cookieInventory.AddItem(item, 1, location, currentRotTime, currentRotRate)) { CookProduct cook = GetComponentInChildren <CookProduct>(); cook.StartTimer(item); } } } }
public static void Insert(CookieItem cookie) { string sql = @"insert into cookie (GUID, UserID) values (@GUID, @UserID)"; SqlHelper.ExecuteNonQuery(sql, new MySqlParameter("@GUID", cookie.GUID), new MySqlParameter("@UserID", cookie.UserID)); }