public ServiceRegistrationSystems(GameContext game, InputContext input, Services.Services services)
     : base(nameof(ServiceRegistrationSystems))
 {
     Add(new RegisterServiceSystem <ITimeService>(services.Time, game.ReplaceTime));
     Add(new RegisterServiceSystem <IInputService>(services.InputService, input.ReplaceInput));
     Add(new RegisterServiceSystem <IRegisterService <IView> >(services.CollidingViewRegister, game.ReplaceCollidingViewRegister));
 }
        static void Main(string[] args)
        {
            Console.WriteLine("Client");
            Services.Services services = new Services.Services();

            Serializer soapSerializer = new Serializer("services.bin", new BinaryFormatter());

            soapSerializer.Serialize(services);
            ClientTCP clientTCP = new ClientTCP("localhost", 34567);

            clientTCP.SendFile(soapSerializer.FileName);
            File.Delete(soapSerializer.FileName);
        }
Ejemplo n.º 3
0
    private void Awake()
    {
        services = new Services.Services
        {
            Time = new UnityTimeService(),
            CollidingViewRegister = new UnityCollidingViewRegister(),
            InputService          = new StandaloneInputService(),
        };

        systems = new MazeFeature
                  (
            Contexts.sharedInstance.game,
            Contexts.sharedInstance.meta,
            Contexts.sharedInstance.input,
            services,
            Prefabs
                  );

        systems.Initialize();
    }
Ejemplo n.º 4
0
        private KitchenOrderPrint GetKitchenOrderPrintModel(Services.Printout order) {
            Services.Item item, itemMenu;
            KitchenOrderPrint model;
            List<LineItem> subItems;

            try {
                model = new KitchenOrderPrint();
                model.Items = new List<LineItem>();
                model.Check = _orderService.GetCheck(order.CheckId);
                model.id = order.id;
                model.CreatedDate = model.Check.DateCreated;
                model.Comments = _commentService.GetItemComment(order.CheckId, Common.CommentType.Check, SessionData.customer.id);

                // If no printers - webSocket not running, or no connection to webSocket
                if (SessionData.printers != null) {
                    model.PrinterKitchenWidth = SessionData.printerKitchenWidth;
                }

                List<Services.ChecksMenu> menus = _orderService.GetMenuItems(order.CheckId);
                List<ChecksMenuProduct> products;
                Boolean ordered;
                foreach (Services.ChecksMenu menuItem in menus) {
                    itemMenu = _itemService.GetItem(menuItem.MenuId);
                    ordered = ((Common.MenuItemStatus)menuItem.Status == Common.MenuItemStatus.Ordered);
                    products = _orderService.GetProducts(menuItem.id);
                    subItems = new List<LineItem>();
                    foreach (Services.ChecksMenuProduct productItem in products) {
                        foreach (Services.ChecksMenuProductItem associatedItem in productItem.ChecksMenuProductItems) {
                            item = _itemService.GetItemProductAssosiationsById(associatedItem.ItemId);
                            if (item != null) {
                                subItems.Add(new LineItem() { Description = item.Name, Ordered = ordered });
                            }
                        }
                    }
                    model.Items.Add(new LineItem() { Description = itemMenu.Name, Ordered = ordered, id = itemMenu.id, Comments = _commentService.GetItemComment(menuItem.id, Common.CommentType.MenuItem, SessionData.customer.id), SubItems = subItems });
                    _orderService.UpdateMenuItemStatus(menuItem.id, Common.MenuItemStatus.Ordered);
                }
            }
            catch (Exception ex) {
                base.Log(ex);
                return null;
            }
            finally {
            }

            return model;
        }
Ejemplo n.º 5
0
 public String PrintKitchenOrders(Services.Printout order) {
     KitchenOrderPrint model = GetKitchenOrderPrintModel(order);
     return RenderViewToString(this.ControllerContext, "Printouts/_SendKitchenOrder2PrinterPartial", model);
 }