public static Store initValidStore() { StoreManagment sm = StoreManagment.Instance; UserManager userManager = UserManager.Instance; userManager.Register("shimon", "123"); userManager.Login("shimon", "123", false); sm.createStore("shimon", "Store"); userManager.Register("yosi", "123"); userManager.Login("yosi", "123"); userManager.Register("shmuel", "123"); userManager.Login("shmuel", "123"); AppoitmentManager appmgr = AppoitmentManager.Instance; appmgr.AppointStoreManager("shimon", "shmuel", 100); appmgr.AppointStoreManager("shimon", "yosi", 100); userManager.GetAtiveUser("shmuel").setPermmisions(100, new int[] { 0, 0, 1, 0, 0 }); userManager.GetAtiveUser("yosi").setPermmisions(100, new int[] { 1, 1, 0, 0, 0 }); Store validStore = sm.getStore(100); validStore.Inventory = InventoryTest.getInventory(InventoryTest.getValidInventroyProdList()); return(validStore); }
// Use this for initialization void Start() { Cursor.lockState = wantedMode; player = GetComponent <Rigidbody>(); handScript = hand.GetComponent <HandTest>(); visionScript = vision.GetComponent <VisionTest>(); inventarioPossivel = GetComponent <InventoryTest>(); if (fovInicial == 0) { fovInicial = 70f; } if (zoomMaximo == 0) { zoomMaximo = fovInicial - 20f; } actualFoV = fovInicial; eyes.fieldOfView = actualFoV; if (feet == null) { feet = GetComponentInChildren <FeetTest>(); } }
void Start() { gold = GameObject.FindGameObjectWithTag("Player").GetComponent <GoldScore>(); inventoryTest = GameObject.FindGameObjectWithTag("Player").GetComponent <InventoryTest>(); for (int i = 0; i < 3; i++) { slots[i] = -1; } }
public override void OnInspectorGUI() { DrawDefaultInspector(); InventoryTest script = (InventoryTest)target; if (GUILayout.Button("Use Potion")) { script.UsePotion(); } }
void Start() { inventoryTest = GameObject.FindGameObjectWithTag("Player").GetComponent <InventoryTest>(); usedItem = GameObject.FindGameObjectWithTag("Player").GetComponent <UsedItemsTest>(); if (PlayerPrefs.GetInt("ResetGame") == 1) { ResetInventory(); } else { CheckItem(); } }
public static StoreManagment getValidStoreManagmet() { UserManager userManger = UserManager.Instance; userManger.Register("liav", "123"); userManger.Register("sundy", "125"); userManger.Register("yosef", "127"); userManger.Login("liav", "123", false); userManger.Login("sundy", "125"); List <Tuple <Product, int> > lstProds = new List <Tuple <Product, int> >(); Product p1_firstStore = new Product(pid: 1, sid: 1, price: 10000, name: "Dell Xps 9560", rank: 4, category: CommonStr.ProductCategoty.Computers); lstProds.Add(new Tuple <Product, int>(p1_firstStore, 100)); lstProds.Add(new Tuple <Product, int>(new Product(pid: 2, sid: 1, name: "Ninja Blender V3", price: 450, rank: 2, category: CommonStr.ProductCategoty.Kitchen), 200)); lstProds.Add(new Tuple <Product, int>(new Product(pid: 3, sid: 1, name: "MegaMix", price: 1000, rank: 5, category: CommonStr.ProductCategoty.Kitchen), 300)); lstProds.Add(new Tuple <Product, int>(new Product(pid: 4, sid: 1, name: "makeup loreal paris", price: 200, rank: 3, category: CommonStr.ProductCategoty.Beauty), 0)); Inventory inv_store_1 = InventoryTest.getInventory(lstProds); Store store1 = StoreTest.StoreTest.openStore(storeId: 1, user: userManger.GetUser("liav"), inv: inv_store_1, rank: 4, CommonStr.StoreParams.StoreName); List <Tuple <Product, int> > lstProds2 = new List <Tuple <Product, int> >(); lstProds2.Add(new Tuple <Product, int>(new Product(pid: 1, sid: 2, price: 650, name: "Keyboard Mx95 Lgoitech", rank: 4, category: CommonStr.ProductCategoty.Computers), 100)); lstProds2.Add(new Tuple <Product, int>(new Product(pid: 2, sid: 2, name: "Elctricty Knife", price: 450, rank: 5, category: CommonStr.ProductCategoty.Kitchen), 200)); lstProds2.Add(new Tuple <Product, int>(new Product(pid: 3, sid: 2, name: "MegaMix v66", price: 1500, rank: 1, category: CommonStr.ProductCategoty.Kitchen), 300)); lstProds2.Add(new Tuple <Product, int>(new Product(pid: 4, sid: 2, name: "Lipstick in955", price: 200, rank: 3, category: CommonStr.ProductCategoty.Beauty), 10)); Inventory inv_store_2 = InventoryTest.getInventory(lstProds2); Store store2 = StoreTest.StoreTest.openStore(storeId: 2, user: userManger.GetUser("sundy"), inv: inv_store_2, rank: 3); List <Tuple <Product, int> > lstProd3 = new List <Tuple <Product, int> >(); lstProd3.Add(new Tuple <Product, int>(new Product(pid: 1, sid: 3, price: 50, name: "Mouse Mx95 Lgoitech", rank: 2, category: CommonStr.ProductCategoty.Computers), 100)); lstProd3.Add(new Tuple <Product, int>(new Product(pid: 2, sid: 3, name: "Nespresso Latsima Touch Coffe Machine", price: 1400, rank: 2, category: CommonStr.ProductCategoty.Kitchen), 200)); lstProd3.Add(new Tuple <Product, int>(new Product(pid: 3, sid: 3, name: "MegaMix v41", price: 1500, rank: 4, category: CommonStr.ProductCategoty.Kitchen), 300)); lstProd3.Add(new Tuple <Product, int>(new Product(pid: 4, sid: 3, name: "makeup loreal paris", price: 200, rank: 5, category: CommonStr.ProductCategoty.Beauty), 10)); Inventory inv_store_3 = InventoryTest.getInventory(lstProd3); Store store3 = StoreTest.StoreTest.openStore(storeId: 3, user: userManger.GetUser("yosef"), inv: inv_store_3, rank: 1); store3.ActiveStore = false; Dictionary <int, Store> storesDictionary = new Dictionary <int, Store>(); storesDictionary.Add(1, store1); storesDictionary.Add(2, store2); storesDictionary.Add(3, store3); StoreManagment.Instance.setStores(storesDictionary); return(StoreManagment.Instance); }
public void TestInitialize() { User user = new User(1, null, true, true); List <Tuple <Product, int> > lstProds = new List <Tuple <Product, int> >(); lstProds.Add(new Tuple <Product, int>(new Product(pid: 1, sid: 1, price: 10000, name: "Dell Xps 9560", rank: 4, category: CommonStr.ProductCategoty.Computers), 100)); lstProds.Add(new Tuple <Product, int>(new Product(pid: 2, sid: 1, name: "Ninja Blender V3", price: 450, rank: 2, category: CommonStr.ProductCategoty.Kitchen), 200)); lstProds.Add(new Tuple <Product, int>(new Product(pid: 3, sid: 1, name: "MegaMix", price: 1000, rank: 5, category: CommonStr.ProductCategoty.Kitchen), 300)); lstProds.Add(new Tuple <Product, int>(new Product(pid: 4, sid: 1, name: "makeup loreal paris", price: 200, rank: 3, category: CommonStr.ProductCategoty.Beauty), 0)); inv_store_1 = InventoryTest.getInventory(lstProds); Store store1 = StoreTest.StoreTest.openStore(storeId: 1, user: user, inv: inv_store_1, rank: 4); List <Tuple <Product, int> > lstProds2 = new List <Tuple <Product, int> >(); lstProds2.Add(new Tuple <Product, int>(new Product(pid: 1, sid: 2, price: 650, name: "Keyboard Mx95 Lgoitech", rank: 4, category: CommonStr.ProductCategoty.Computers), 100)); lstProds2.Add(new Tuple <Product, int>(new Product(pid: 2, sid: 2, name: "Elctricty Knife", price: 450, rank: 5, category: CommonStr.ProductCategoty.Kitchen), 200)); lstProds2.Add(new Tuple <Product, int>(new Product(pid: 3, sid: 2, name: "MegaMix v66", price: 1500, rank: 1, category: CommonStr.ProductCategoty.Kitchen), 300)); lstProds2.Add(new Tuple <Product, int>(new Product(pid: 4, sid: 2, name: "Lipstick in955", price: 200, rank: 3, category: CommonStr.ProductCategoty.Beauty), 10)); inv_store_2 = InventoryTest.getInventory(lstProds2); Store store2 = StoreTest.StoreTest.openStore(storeId: 2, user: user, inv: inv_store_2, rank: 3); List <Tuple <Product, int> > lstProd3 = new List <Tuple <Product, int> >(); lstProd3.Add(new Tuple <Product, int>(new Product(pid: 1, sid: 3, price: 50, name: "Mouse Mx95 Lgoitech", rank: 2, category: CommonStr.ProductCategoty.Computers), 100)); lstProd3.Add(new Tuple <Product, int>(new Product(pid: 2, sid: 3, name: "Nespresso Latsima Touch Coffe Machine", price: 1400, rank: 2, category: CommonStr.ProductCategoty.Kitchen), 200)); lstProd3.Add(new Tuple <Product, int>(new Product(pid: 3, sid: 3, name: "MegaMix v41", price: 1500, rank: 4, category: CommonStr.ProductCategoty.Kitchen), 300)); lstProd3.Add(new Tuple <Product, int>(new Product(pid: 4, sid: 3, name: "makeup loreal paris", price: 200, rank: 5, category: CommonStr.ProductCategoty.Beauty), 10)); inv_store_3 = InventoryTest.getInventory(lstProd3); Store store3 = StoreTest.StoreTest.openStore(storeId: 3, user: user, inv: inv_store_3, rank: 1); Dictionary <int, Store> storesDictionary = new Dictionary <int, Store>(); storesDictionary.Add(1, store1); storesDictionary.Add(2, store2); storesDictionary.Add(3, store3); storeManagment = StoreManagment.Instance; storeManagment.setStores(storesDictionary); searcher = new Searcher(storeManagment); }
void Start() { inventoryTest = GameObject.FindGameObjectWithTag("Player").GetComponent <InventoryTest>(); quitCrafting = GameObject.FindGameObjectWithTag("BackButton").GetComponent <QuitCrafting>(); }
static void T() { string[] hotelIds = File.ReadAllLines("c:\\hotelId.txt"); foreach (string id in hotelIds) { if (string.IsNullOrEmpty(id)) { continue; } bool showed = false; var r1 = new HotelDetailTest(); r1.Condition = new HotelDetailCondition() { ArrivalDate = DateTime.Now.Date.AddDays(4), DepartureDate = DateTime.Now.Date.AddDays(6), HotelIds = id, }; BaseResponse <HotelList> detail = r1.Test(); if (detail.Code == "0" && detail.Result != null) { var hs = detail.Result.Hotels; if (hs != null) { foreach (var h in hs) { if (h.Rooms != null) { var r2 = new InventoryTest(); r2.Condition = new InventoryCondition() { StartDate = DateTime.Now.Date.AddDays(4), EndDate = DateTime.Now.Date.AddDays(6), HotelIds = id }; var res2 = r2.Test(); bool ok = true; if (res2.Result.Inventories != null) { foreach (var inv in res2.Result.Inventories) { ok = ok && inv.Status; } //Console.WriteLine("\t\tinv: " + ok); } var r3 = new RateTest(); r3.Condition = new RateCondition() { StartDate = DateTime.Now.Date.AddDays(4), EndDate = DateTime.Now.Date.AddDays(6), HotelIds = id, PaymentType = EnumPaymentType.Prepay }; var res3 = r3.Test(); if (res3.Result.Rates != null) { //Console.WriteLine("\t\trate: " + res3.Result.Rates.Length); } foreach (var r in h.Rooms) { if (r.RatePlans != null) { foreach (var rp in r.RatePlans) { if (rp.PaymentType == EnumPaymentType.Prepay) { int invCount = 0; if (res2.Result.Inventories != null) { foreach (var inv in res2.Result.Inventories) { if (inv.RoomTypeId == r.RoomId) { invCount = inv.Status ? (inv.OverBooking == 0 ? 999 : inv.Amount) : -1; } } } decimal price = 0M; if (res3.Result.Rates != null) { foreach (var rate in res3.Result.Rates) { if (rate.Status && rate.StartDate <= r2.Condition.StartDate && rate.EndDate >= r2.Condition.EndDate) { price = rate.MemberCost; } } } Console.WriteLine(string.Format("{0} {1} {2} {3} {4}", h.HotelId, r.RoomId, rp.RatePlanId, invCount, price)); showed = true; } } } } } } } } if (!showed) { Console.WriteLine("===> " + id); } } }
void Start() { inventoryTest = GameObject.FindGameObjectWithTag("Player").GetComponent <InventoryTest>(); }
void Start() { inventoryTest = GameObject.FindGameObjectWithTag("Player").GetComponent <InventoryTest>(); usedItem = GameObject.FindGameObjectWithTag("Player").GetComponent <UsedItemsTest>(); CheckItem(); }
void Start() { inventoryTest = GameObject.FindGameObjectWithTag("Player").GetComponent <InventoryTest>(); craftingItem = GameObject.FindGameObjectWithTag("Player").GetComponent <CraftingSlots>(); }