Exemple #1
0
        public EquipmentWindow(IGuiServices guiServices, ITexts texts) : base(guiServices)
        {
            _backgroundImage = GuiServices.ImagesStore.GetImage("equipment.background");

            _bodyItemsControl         = new BodyItemsControl(GuiServices);
            _backpackItemsControl     = new BackpackItemsControl(GuiServices);
            _groundItemsControl       = new GroundItemsControl(GuiServices);
            _navigationButtonsControl = new NavigationButtonsControl(GuiServices);
            _itemsInfoControl         = new ItemsInfoControl(GuiServices, texts);
            _characterInfoControl     = new CharacterInfoControl(GuiServices, texts);
            _dragImage = new Image(GuiServices);

            AddElement(_bodyItemsControl);
            AddElement(_backpackItemsControl);
            AddElement(_groundItemsControl);
            AddElement(_navigationButtonsControl);
            AddElement(_itemsInfoControl);
            AddElement(_characterInfoControl);
            AddElement(_dragImage);

            _navigationButtonsControl.PrevClicked += OnPrevClicked;
            _navigationButtonsControl.NextClicked += OnNextClicked;
            _backpackItemsControl.ItemClicked     += OnBackpackItemClicked;
            _bodyItemsControl.ItemClicked         += OnBodyItemClicked;
        }
Exemple #2
0
        public LoadGameWindow(IGuiServices guiServices, ITexts texts) : base(guiServices)
        {
            //TODO: keep archives path in common place
            //TODO: sort out this line:
            var archives = Directory.EnumerateFiles(Path.Combine("data", "archive"))
                           .Take(10)
                           .Select(Path.GetFileName)
                           .ToList();

            var dict = new Dictionary <string, Action <HandledEventArgs> >();

            foreach (var name in archives)
            {
                dict.Add(name, args =>
                {
                    ArchiveNameClicked?.Invoke(args, name);
                    Closing?.Invoke(args);
                });
            }
            dict.Add(texts.Get("exit"), args =>
            {
                ExitClicked?.Invoke(args);
                Closing?.Invoke(args);
            });
            ButtonNames = dict;
        }
Exemple #3
0
 public MenuLayer(IGuiServices guiServices,
                  IViewSwitcher viewSwitcher,
                  ITexts texts,
                  ICommonGuiFactory commonGuiFactory) : base(guiServices)
 {
     _viewSwitcher     = viewSwitcher;
     _texts            = texts;
     _commonGuiFactory = commonGuiFactory;
 }
Exemple #4
0
 public GameChartsWindow(
     IGuiServices guiServices,
     ITexts texts,
     IPlayersRepository playersRepository) : base(guiServices)
 {
     _texts             = texts;
     _playersRepository = playersRepository;
     CreateElements();
 }
Exemple #5
0
        public MapMessagesService(ModalLayer messagesLayer,
                                  IGuiServices guiServices,
                                  ITexts texts)
        {
            _messagesLayer = messagesLayer;
            _guiServices   = guiServices;
            _texts         = texts;
            _dict          = new Dictionary <MessageType, string>();

            LoadData();
        }
Exemple #6
0
 public CommonGuiFactory(
     IGuiServices guiServices,
     ITexts texts,
     IGameArchive gameArchive,
     IViewSwitcher viewSwitcher)
 {
     _guiServices  = guiServices;
     _texts        = texts;
     _gameArchive  = gameArchive;
     _viewSwitcher = viewSwitcher;
 }
Exemple #7
0
        public GameStatisticsWindow(
            IGuiServices guiServices,
            ITexts texts,
            ILegionInfo legionInfo,
            IMapController mapController,
            IPlayersRepository playersRepository) : base(guiServices)
        {
            _texts             = texts;
            _legionInfo        = legionInfo;
            _mapController     = mapController;
            _playersRepository = playersRepository;

            CreateElements();
        }
Exemple #8
0
        public MapCityGuiFactory(
            IGuiServices guiServices,
            ILegionConfig legionConfig,
            ITexts texts,
            ICommonMapGuiFactory commonMapGuiFactory,
            ModalLayer modalLayer)
        {
            _guiServices         = guiServices;
            _legionConfig        = legionConfig;
            _texts               = texts;
            _commonMapGuiFactory = commonMapGuiFactory;
            _modalLayer          = modalLayer;

            guiServices.GameLoaded += LoadImages;
        }
Exemple #9
0
 public MapGuiLayer(
     IGuiServices guiServices,
     IMapController mapController,
     ITexts texts,
     IPlayersRepository playersRepository,
     ILegionInfo legionInfo,
     ModalLayer modalLayer,
     ICommonGuiFactory commonGuiFactory) : base(guiServices)
 {
     _mapController     = mapController;
     _texts             = texts;
     _playersRepository = playersRepository;
     _legionInfo        = legionInfo;
     _modalLayer        = modalLayer;
     _commonGuiFactory  = commonGuiFactory;
 }
Exemple #10
0
    // it has to load before all script
    void Awake()
    {
        // check which language is in the device
        if (Application.systemLanguage.ToString().Equals("Portuguese"))
        {
            texts = new PortuguesTexts();

            language = LanguageType.Portuguese;
        }
        else
        {
            texts = new EnglishTexts();

            language = LanguageType.English;
        }
    }
Exemple #11
0
 public CityOrdersWindow(IGuiServices guiServices, ITexts texts) : base(guiServices)
 {
     //TODO: provide translations for all items here
     ButtonNames = new Dictionary <string, Action <HandledEventArgs> >
     {
         {
             "Podatki", args =>
             {
                 TaxesClicked?.Invoke(args);
                 Closing?.Invoke(args);
             }
         },
         {
             "Nowy Legion", args =>
             {
                 NewLegionClicked?.Invoke(args);
                 Closing?.Invoke(args);
             }
         },
         {
             "Rozbudowa", args =>
             {
                 BuildClicked?.Invoke(args);
                 Closing?.Invoke(args);
             }
         },
         {
             "Budowa Murow", args =>
             {
                 WallsBuildClicked?.Invoke(args);
                 Closing?.Invoke(args);
             }
         },
         {
             texts.Get("exit"), args =>
             {
                 ExitClicked?.Invoke(args);
                 Closing?.Invoke(args);
             }
         }
     };
 }
Exemple #12
0
        public ArmyOrdersWindow(IGuiServices guiServices,
                                ITexts texts,
                                bool isTerrainActionButtonVisible,
                                bool isRecruitButtonVisible) : base(guiServices)
        {
            var dict = new Dictionary <string, Action <HandledEventArgs> >
            {
                {
                    texts.Get("move"), args =>
                    {
                        MoveClicked?.Invoke(args);
                        Closing?.Invoke(args);
                    }
                },
                {
                    texts.Get("fastMove"), args =>
                    {
                        FastMoveClicked?.Invoke(args);
                        Closing?.Invoke(args);
                    }
                },
                {
                    texts.Get("attack"), args =>
                    {
                        AttackClicked?.Invoke(args);
                        Closing?.Invoke(args);
                    }
                }
            };

            if (isRecruitButtonVisible)
            {
                dict.Add(texts.Get("recruit"), args =>
                {
                    RecruitClicked?.Invoke(args);
                    Closing?.Invoke(args);
                });
            }
            else
            {
                dict.Add(texts.Get("hunt"), args =>
                {
                    HuntClicked?.Invoke(args);
                    Closing?.Invoke(args);
                });
            }

            dict.Add(texts.Get("camp"), args =>
            {
                CampClicked?.Invoke(args);
                Closing?.Invoke(args);
            });

            dict.Add(texts.Get("equipment"), args =>
            {
                EquipmentClicked?.Invoke(args);
                Closing?.Invoke(args);
            });

            if (isTerrainActionButtonVisible)
            {
                dict.Add(texts.Get("action"), args =>
                {
                    ActionClicked?.Invoke(args);
                    Closing?.Invoke(args);
                });
            }

            dict.Add(texts.Get("exit"), args =>
            {
                ExitClicked?.Invoke(args);
                Closing?.Invoke(args);
            });

            ButtonNames = dict;
        }
Exemple #13
0
        public GameOptionsWindow(
            IGuiServices guiServices,
            ITexts texts,
            IPlayersRepository playersRepository,
            ILegionInfo legionInfo) : base(guiServices)
        {
            ButtonWidth = OverrideButtonWidth;

            var day   = legionInfo.CurrentDay;
            var money = playersRepository.UserPlayer.Money;

            var dict = new Dictionary <string, Action <HandledEventArgs> >
            {
                {
                    texts.Get("mapOptions.title", day, money), args => args.Handled = true
                },
                {
                    texts.Get("mapOptions.loadGame"), args =>
                    {
                        LoadGameClicked?.Invoke(args);
                        Closing?.Invoke(args);
                    }
                },
                {
                    texts.Get("mapOptions.saveGame"), args =>
                    {
                        SaveGameClicked?.Invoke(args);
                        Closing?.Invoke(args);
                    }
                },
                {
                    texts.Get("mapOptions.statistics"), args =>
                    {
                        StatisticsClicked?.Invoke(args);
                        Closing?.Invoke(args);
                    }
                },
                {
                    texts.Get("mapOptions.options"), args =>
                    {
                        OptionsClicked?.Invoke(args);
                        Closing?.Invoke(args);
                    }
                },
                {
                    texts.Get("mapOptions.endGame"), args =>
                    {
                        EndGameClicked?.Invoke(args);
                        Closing?.Invoke(args);
                    }
                },
                {
                    texts.Get("mapOptions.exit"), args =>
                    {
                        ExitClicked?.Invoke(args);
                        Closing?.Invoke(args);
                    }
                }
            };

            ButtonNames = dict;
        }
Exemple #14
0
 public ItemsInfoControl(IGuiServices guiServices, ITexts texts) : base(guiServices)
 {
     _texts = texts;
 }
Exemple #15
0
 public CharacterInfoControl(IGuiServices guiServices, ITexts texts) : base(guiServices)
 {
     _texts = texts;
 }
 public UseCase(IBusinesslogic bl, ITexts txt, IPresenter ui)
 {
     _bl  = bl;
     _txt = txt;
     _ui  = ui;
 }