private void OnTriggerStay2D(Collider2D collision) { if (scene.actualPhase == playerPhase) { if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0)) { if (collision.gameObject.tag == "NPC") { npc = collision.GetComponent <MerchantController>(); if (!npc.bocadillo.gameObject.activeSelf) { npc.bocadillo.gameObject.SetActive(true); } npc.Interaction(); } else if (collision.gameObject.tag == "Tree") { aple = collision.GetComponent <ApplleController>(); aple.Interaction(); } else if (collision.gameObject.tag == "Star") { star = collision.GetComponent <StarController>(); star.Interaction(); } } } }
private void Awake() { if (Instance != null) { Destroy(gameObject); } else { Instance = this; } }
public void Init(PgController pgController, AIController aiController, MerchantController merchantController, IMapViewer mapViewer, IAtomListener singleMsgListener, IAnimationViewer animationViewer, List <IPgViewer> pgViewers, List <IAtomListener> atomListeners, List <ISheetViewer> sheetViews, List <IBackpackViewer> backpackViewers, List <ISpellbookViewer> spellbookViewers, List <IAtomListener> secondarySpellsViewers, List <IMerchantViewer> merchantViewers, IMenuViewer mainMenuViewer, MenuController mainMenuController) { CreateFolders(); this.pgController = pgController; this.aiController = aiController; this.merchantController = merchantController; this.mapViewer = mapViewer; this.singleMsgListener = singleMsgListener; this.animationViewer = animationViewer; this.pgViewers = pgViewers; this.atomListeners = atomListeners; this.sheetViews = sheetViews; this.backpackViewers = backpackViewers; this.spellbookViewers = spellbookViewers; this.secondarySpellsViewers = secondarySpellsViewers; this.merchantViewers = merchantViewers; menuViewers = new Dictionary <MenuType, IMenuViewer>(); menuControllers = new Dictionary <MenuType, MenuController>(); menuViewers[MenuType.Main] = mainMenuViewer; menuControllers[MenuType.Main] = mainMenuController; }
private void Awake() { MerchantController.current = this; }
public void Init( PgController pgController, AIController aiController, MerchantController merchantController, IMapViewer mapViewer, IAtomListener singleMsgListener, IAnimationViewer animationViewer, List<IPgViewer> pgViewers, List<IAtomListener> atomListeners, List<ISheetViewer> sheetViews, List<IBackpackViewer> backpackViewers, List<ISpellbookViewer> spellbookViewers, List<IAtomListener> secondarySpellsViewers, List<IMerchantViewer> merchantViewers, IMenuViewer mainMenuViewer, MenuController mainMenuController) { CreateFolders(); this.pgController = pgController; this.aiController = aiController; this.merchantController = merchantController; this.mapViewer = mapViewer; this.singleMsgListener = singleMsgListener; this.animationViewer = animationViewer; this.pgViewers = pgViewers; this.atomListeners = atomListeners; this.sheetViews = sheetViews; this.backpackViewers = backpackViewers; this.spellbookViewers = spellbookViewers; this.secondarySpellsViewers = secondarySpellsViewers; this.merchantViewers = merchantViewers; menuViewers = new Dictionary<MenuType, IMenuViewer>(); menuControllers = new Dictionary<MenuType, MenuController>(); menuViewers[MenuType.Main] = mainMenuViewer; menuControllers[MenuType.Main] = mainMenuController; }
public MerchantControllerTests() { _fixture = new Fixture(); _mockJwtService = new Mock <IJwtService>(); _sut = new MerchantController(_mockJwtService.Object); }
public void RemoveMerchant(MerchantController merchant) { Merchants.Remove(merchant); Destroy(merchant.gameObject); }
public TwiMLResult Index(SmsRequest incomingMessage) { #region early stuff // Step 1: Fixed Text //var messagingResponse = new MessagingResponse(); //messagingResponse.Message("The copy cat says: " + incomingMessage.Body); // Step 2: Media // respond with media //var message = new Message(); //message.Body("The Robots are coming! Head for the hills!"); //message.Media(new Uri(@"https://farm8.staticflickr.com/7090/6941316406_80b4d6d50e_z_d.jpg")); //var messagingResponse = new MessagingResponse(); //messagingResponse.Message(message); //messagingResponse.Append(message); #endregion // Step 3: Variable Reponse string requestBody = incomingMessage.Body.ToLower().Trim(); string requestBody2 = Regex.Replace(requestBody, @"\s+", string.Empty); if (requestBody2.StartsWith(@"saleshttps://")) { requestBody = "sales_alexa"; } // format of sending phoen no is: "+15134986016" string fromPhoneNumber = incomingMessage.From; var response = new MessagingResponse(); // lookup the merchant using the incoming phone number MerchantMBE merchant = MerchantController.LookupMerchant(fromPhoneNumber); if (requestBody == @"help" || requestBody == @"help?" || requestBody == @"???" || requestBody == @"?") { StringBuilder helpMsg = new StringBuilder(); helpMsg.AppendLine(" Available Commands"); helpMsg.AppendLine("------------------------------"); helpMsg.AppendLine("Summary: Today's Summary"); helpMsg.AppendLine("Sales: Today's Sales"); helpMsg.AppendLine("Cback: Pending Chargebacks"); helpMsg.AppendLine("Returns: Today's Returns"); helpMsg.AppendLine("Stop: Unsubscribe"); helpMsg.AppendLine("FAF: Sign-up for Fast Access"); helpMsg.AppendLine("help?: this list"); helpMsg.AppendLine("join: resend welcome message"); //helpMsg.AppendLine("unjoin: reverse join (for testing)"); helpMsg.AppendLine("Settings: view/update alert settings"); helpMsg.AppendLine("User: Account Details"); response.Message(helpMsg.ToString()); } else if (requestBody == @"summary") { DateTime xctPostingDate = DateTime.Today; string salesInfo = MerchantController.BuildSummaryMessage(merchant.merchant_id, xctPostingDate); response.Message(salesInfo); } else if (requestBody == @"sales") { DateTime xctPostingDate = DateTime.Today; string salesInfo = MerchantController.BuildSalesSummaryMessage(merchant.merchant_id, xctPostingDate); response.Message(salesInfo); } else if (requestBody == @"cback" || requestBody == @"chargeback" || requestBody == @"chargebacks") { DateTime xctPostingDate = DateTime.Today; string salesInfo = MerchantController.BuildChargebackDetails(merchant.merchant_id, xctPostingDate); response.Message(salesInfo); } else if (requestBody == @"returns" || requestBody == @"refunds") { DateTime xctPostingDate = DateTime.Today; string refundsInfo = MerchantController.BuildReturnsSummaryMessage(merchant.merchant_id, xctPostingDate); response.Message(refundsInfo); } else if (requestBody == @"faf") { DateTime xctPostingDate = DateTime.Today; string faf = MerchantController.BuildFAFMessage(merchant.merchant_id, xctPostingDate); response.Message(faf); } else if (requestBody == @"confirm") { DateTime xctPostingDate = DateTime.Today; string fafMsg = MerchantController.BuildConfirmFAFMessage(merchant.merchant_id, xctPostingDate); response.Message(fafMsg); } else if (requestBody == @"undo") { DateTime xctPostingDate = DateTime.Today; string fafMsg = MerchantController.BuildUndoFAFMessage(merchant.merchant_id, xctPostingDate); response.Message(fafMsg); } else if (requestBody == @"join") { string welcomeMsg = MerchantController.BuildWelcomeMessage(merchant); string configMsg = MerchantController.BuildConfigMessage(merchant.merchant_id); response.Message($"{welcomeMsg}\n{configMsg}"); } else if (requestBody == @"unjoin") { string unjoinMsg = MerchantController.ResetAcceptedJoin(merchant.merchant_id); response.Message(unjoinMsg); } else if (requestBody == @"config" || requestBody == @"settings") { string msg = MerchantController.BuildConfigMessage(merchant.merchant_id); response.Message(msg); } else if (requestBody == @"user" || requestBody == @"whoami") { string msg = $"Hi {merchant.primary_contact.first_name} !\n{merchant.merchant_name} [id: {merchant.merchant_id}]\np: {merchant.primary_contact.phone_no}"; response.Message(msg); } else if (requestBody == @"sales_alexa") { response.Message("Getting Closer to WOW"); } else if (requestBody == @"yes") // welcome accept { string msg = MerchantController.AcceptWelcomeMessage(merchant.merchant_id, true); response.Message(msg); } else if (requestBody == @"status") { response.Message(@"not closed"); } else if (requestBody == @"testurl") { string msg = @"https://www.google.com"; response.Message(msg); } else if (requestBody == @"testnew") { string welcomeMsg = MerchantController.BuildWelcomeMessage(merchant); response.Message(welcomeMsg); } else if (requestBody == @"testaccept") { string welcomeMsg = MerchantController.TestWelcomeAccept(merchant.merchant_id); response.Message(welcomeMsg); } else { response.Message($"Sorry I do not understand [{requestBody}], text help? to see a list of the available commmands."); } return(TwiML(response)); }
static void DisplayMenu() { // display options menu ConsoleColor defaultColor = ConsoleColor.Gray; System.Console.ForegroundColor = defaultColor; System.Console.Clear(); System.Console.ForegroundColor = ConsoleColor.Blue; System.Console.WriteLine("============================================="); System.Console.WriteLine(" Hackathon Test Methods"); System.Console.WriteLine("============================================="); System.Console.ForegroundColor = defaultColor; System.Console.WriteLine(); System.Console.ForegroundColor = ConsoleColor.Magenta; System.Console.WriteLine("=== SMS Test Messages ======================="); System.Console.ForegroundColor = defaultColor; System.Console.WriteLine("1.1 Test Message to Tom's Phone"); System.Console.WriteLine(""); System.Console.ForegroundColor = ConsoleColor.Magenta; System.Console.WriteLine("=== Generate Xcts ==========================="); System.Console.ForegroundColor = defaultColor; System.Console.WriteLine("2.1 Clear Xcts"); System.Console.WriteLine("2.2 Generate Purchases"); System.Console.WriteLine("2.3 Generate Returns"); System.Console.WriteLine("2.4 Generate Chargebacks"); System.Console.WriteLine("2.5 Fire All Terminals Closed Event"); System.Console.WriteLine("2.6 Fire Closed Event for all Merchants"); System.Console.WriteLine(""); System.Console.ForegroundColor = ConsoleColor.Magenta; System.Console.WriteLine("=== Support ==========================="); System.Console.ForegroundColor = defaultColor; System.Console.WriteLine("3.1 Load Merchant"); System.Console.WriteLine("3.2 Load ALL Merchants"); System.Console.WriteLine("3.3 Send Welcome Message"); System.Console.WriteLine(""); System.Console.WriteLine(); System.Console.Write("Enter # or 0 to Exit"); System.Console.ForegroundColor = ConsoleColor.Green; System.Console.Write(" > "); System.Console.ForegroundColor = defaultColor; var selectionString = System.Console.ReadLine(); decimal selection = !string.IsNullOrEmpty(selectionString.Trim()) ? decimal.Parse(selectionString) : 0; int merchantId = 0; switch (selection) { case 1.1M: // Test Message to Tom's Phone TwilioController.SendTestSMSMessage(GeneralConstants.TOMS_PHONE_NO); break; case 2.1M: // Clear Purchaes for Merchant N System.Console.Write("MerchantId:> "); merchantId = Int32.Parse(System.Console.ReadLine()); MerchantController.ResetAllXctsForMerchantDate(merchantId, DateTime.Today); break; case 2.2M: // Purchases for Merchant N System.Console.Write("MerchantId:> "); merchantId = Int32.Parse(System.Console.ReadLine()); MerchantController.GenerateRandomPurchaseXcts(merchantId); break; case 2.3M: // Generate refunds System.Console.Write("MerchantId:> "); merchantId = Int32.Parse(System.Console.ReadLine()); MerchantController.GenerateRefundXcts(merchantId); break; case 2.4M: // Generate chargebacks System.Console.Write("MerchantId:> "); merchantId = Int32.Parse(System.Console.ReadLine()); MerchantController.GenerateChargebacksXcts(merchantId); break; case 2.5M: // Fire all terminals closed event System.Console.Write("MerchantId:> "); merchantId = Int32.Parse(System.Console.ReadLine()); MerchantController.FireAllTerminalsClosedEvent(merchantId); break; case 2.6M: // Fire all terminals closed event System.Console.Write("MerchantId:> "); merchantId = Int32.Parse(System.Console.ReadLine()); MerchantController.FireClosedEventsForAllMerchants(); break; case 3.1M: // Create Merchant System.Console.Write("MerchantId:> "); merchantId = Int32.Parse(System.Console.ReadLine()); MerchantController.CreateMerchant(merchantId); break; case 3.2M: // Create All Merchants MerchantController.CreateAllMerchants(); break; case 3.3M: // Send Welcome Message System.Console.Write("MerchantId:> "); merchantId = Int32.Parse(System.Console.ReadLine()); MerchantController.SendWelcomeMessage(merchantId); break; default: break; } if (selection != 0) { DisplayMenu(); } }