Inheritance: MonoBehaviour
Example #1
0
    public override async Task OnClick()
    {
        try {
            await GameState.SetCurrentWorldByWorldIndex(WorldIndex);

            UIEvents.ChangeGameText(GameTextId.WorldName, GameState.CurrentWorld.World.Name);

            var character = GameState.GetCharacterByWorldId(GameState.CurrentWorld.World.Id);

            if (character == null)
            {
                LOG.Log($"Player does not have a character on world: {GameState.CurrentWorld.World.Id}");
                await ScreenChangerService.ChangeScreen(ScreenId.CreateCharacter);
            }
            else
            {
                LOG.Log($"Found Character!");
                GameState.CurrentCharacter = character;
                await ScreenChangerService.ChangeScreen(ScreenId.SelectCharacter);
            }
        }
        catch (System.Exception e) {
            LOG.Log(e);
            throw;
        }
    }
Example #2
0
    /// <summary>
    /// 添加联系
    /// </summary>
    /// <param name="ue"></param>
    /// <returns></returns>
    List <UIEvents> AddContact(UIEvents ue)
    {
        int id = ue.id;
        //Debug.Log("ue.id::::"+ue.id);
        List <UIEvents> Relative = new List <UIEvents>();

        for (int i = 0; i < buttonnames.Count; i++)
        {
            //检查节点,在比其ID*10大且在+10以内
            if (childitems[buttonnames[i]].id > id * 10 && childitems[buttonnames[i]].id < id * 10 + 10)
            {
                //   Debug.Log(ue.name +"<<<<<"+ue.id+ "添加子关系:::" + childitems[buttonnames[i]].id);
                Relative.Add(childitems[buttonnames[i]]);

                childitems[buttonnames[i]].parent_contact = ue;
            }
        }
        for (int i = 0; i < buttonnames.Count; i++)
        {
            if (childitems[buttonnames[i]].id == id / 10)
            {
                //   Relative.Add(childitems[buttonnames[i]]);
                //   Debug.Log("找到::" + ue.name + "的父物体::::" + childitems[buttonnames[i]].name);
            }
        }
        return(Relative);
    }
Example #3
0
    void Start()
    {
        //子button的数目必须和进度XML的子节点数目相同
        if (buttonnames == null)
        {
            buttonnames = new List <string>(Date.GetInstance.MODELTOSTEP.Keys);
        }
        if (steps == null)
        {
            steps = new List <List <int> >(Date.GetInstance.MODELTOSTEP.Values);
        }
        if (childitems == null)
        {
            childitems = new Dictionary <string, UIEvents>();
            //Add进字典时,childitems还没有添加完成
            for (int i = 0; i < transform.childCount; i++)
            {
                UIEvents ue = transform.GetChild(i).GetComponent <UIEvents>();
                if (ue)
                {
                    ue.Init(this, buttonnames[i], steps[i][0], steps[i][1], steps[i][2]);
                    childitems.Add(buttonnames[i], ue);
                }
            }
        }

        InitAssigne();
    }
Example #4
0
        public ShooterCreateViewModel()
        {
            AddToAssingedParticipationCommand = new RelayCommand <ParticipationListItem>(ExecuteAddToAssignedParticipationCommand,
                                                                                         CanExecuteAddtoAssignedParticipationCommand);
            RemoveFromAssingedParticipationCommand =
                new RelayCommand <ShooterParticipationListItem>(ExecuteRemoveFromAssignedParticipationCommand,
                                                                CanExecuteRemoveFromAssignedParticipationCommand);
            CancelCommand        = new RelayCommand <object>(ExecuteCloseCommand);
            CreateShooterCommand = new RelayCommand <UiPerson>(ExecuteCreateShooterCommand, CanExecuteCreateShooterCommand);

            if (!DesignTimeHelper.IsInDesignMode)
            {
                IConfiguration config = ConfigurationSource.Configuration;
                _participationDataStore        = config.GetParticipationDataStore();
                _windowService                 = config.GetWindowService();
                _shooterParticipationDataStore = config.GetShooterParticipationDataStore();
                _uiEvents = config.GetUIEvents();
                _uiEvents.PersonSelected += person => { UiPerson = person; };
                _uiEvents.RequireSelectedPerson();
                _shooterNumberService        = config.GetShooterNumberService();
                _shooterDataStore            = config.GetShooterDataStore();
                _shooterParticipationView    = config.GetShooterParticipationView();
                _ssvShooterDataWriterService = config.GetSsvShooterDataWriterService();
                LoadAvailableParticipationList();
                LoadAssignedParticipationList();
            }
        }
Example #5
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
    public ShooterCreateViewModel()
    {
      AddToAssingedParticipationCommand = new RelayCommand<ParticipationListItem>(ExecuteAddToAssignedParticipationCommand,
        CanExecuteAddtoAssignedParticipationCommand);
      RemoveFromAssingedParticipationCommand =
        new RelayCommand<ShooterParticipationListItem>(ExecuteRemoveFromAssignedParticipationCommand,
          CanExecuteRemoveFromAssignedParticipationCommand);
      CancelCommand = new RelayCommand<object>(ExecuteCloseCommand);
      CreateShooterCommand = new RelayCommand<UiPerson>(ExecuteCreateShooterCommand, CanExecuteCreateShooterCommand);

      if (!DesignTimeHelper.IsInDesignMode)
      {
        IConfiguration config = ConfigurationSource.Configuration;
        _participationDataStore = config.GetParticipationDataStore();
        _windowService = config.GetWindowService();
        _shooterParticipationDataStore = config.GetShooterParticipationDataStore();
        _uiEvents = config.GetUIEvents();
        _uiEvents.PersonSelected += person => { UiPerson = person; };
        _uiEvents.RequireSelectedPerson();
        _shooterNumberService = config.GetShooterNumberService();
        _shooterDataStore = config.GetShooterDataStore();
        _shooterParticipationView = config.GetShooterParticipationView();
        _ssvShooterDataWriterService = config.GetSsvShooterDataWriterService();
        LoadAvailableParticipationList();
        LoadAssignedParticipationList();
      }
    }
Example #7
0
        public DefaultConfiguration()
        {
            //_shootingRange = new SiusDataFileProvider(@"C:\Users\eberlid\Dropbox\SSC\2014\Herbstschiessen\ShootingRange\20140516_164043.log");
            //_shootingRange = new SiusDataFileProvider(@"C:\Users\eberlid\Documents\My Dropbox\SSC\2014\Herbstschiessen\ShootingRange\20140516_164043.log");
            //_shootingRange = new SiusDataFileProvider(@"C:\Users\eberlid\Dropbox\SSC\2014\Herbstschiessen\ShootingRange\20130914_132912.log");
            //_shootingRange = new SiusApiProvider("http://192.168.1.4");
            _shootingRange = new SiusDataSocketProvider("127.0.0.1", 4000);
            _events        = new ShootingRangeEvents();
            _uiEvents      = new UIEvents();
            ShootingRangeEntities entities = new ShootingRangeEntities();

            _personRepository                        = new PersonDataStore(entities);
            _shooterRepository                       = new ShooterDataStore(entities);
            _participationDataStore                  = new ParticipationDataStore(entities);
            _sessionDataStore                        = new SessionDataStore(entities);
            _shotDataStore                           = new ShotDataStore(entities);
            _sessionDetailsView                      = new SessionDetailsView(entities);
            _shooterNumberConfigDataStore            = new ShooterNumberConfigDataStore(entities);
            _shooterParticipationDataStore           = new ShooterParticipationDataStore(entities);
            _sessionSubtotalDataStore                = new SessionSubtotalDataStore(entities);
            _programItemDataStore                    = new ProgramItemDataStore(entities);
            _groupMemberDetailsView                  = new GroupMemberDetailsView(entities);
            _groupDetailsView                        = new GroupDetailsView(entities);
            _shooterParticipationView                = new ShooterParticipationView(entities);
            _windowService                           = new WindowService();
            _barcodePrintService                     = new PtouchBarcodePrinter();
            _barcodeBuilderService                   = new Barcode2Of5InterleavedService();
            _shooterNumberService                    = new ShooterNumberService(_shooterNumberConfigDataStore);
            _shooterCollectionParticipationDataStore = new ShooterCollectionParticipationDataStore(entities);
            _shooterCollectionDataStore              = new ShooterCollectionDataStore(entities);
            _collectionShooterDataStore              = new CollectionShooterDataStore(entities);
            _ssvShooterDataWriterService             = new SsvFileWriter(@"C:\Sius\SiusData\SSVDaten\SSV_schuetzen.txt");
        }
    public EditPassViewModel()
    {
      if (!DesignTimeHelper.IsInDesignMode)
      {
        IConfiguration config = ConfigurationSource.Configuration;
        _shooterDatastore = config.GetShooterDataStore();
        _sessionDatastore = config.GetSessionDataStore();
        _programItemDatastore = config.GetProgramItemDataStore();
        _personDatastore = config.GetPersonDataStore();
        _windowService = config.GetWindowService();
        _events = config.GetUIEvents();

        List<UiShooter> shooters = _shooterDatastore.GetAll().Select(UiBusinessObjectMapper.ToUiShooter).ToList();
        shooters.ForEach(_ => { if (_.PersonId != null) _.FetchPerson(_personDatastore.FindById((int) _.PersonId)); });
        UiShooters = new ObservableCollection<UiShooter>(shooters.OrderBy(_ => _.LastName).ThenBy(_ => _.FirstName));

        SearchShooterCommand = new RelayCommand<string>(ExecuteSearchShooterCommand, CanExecuteSearchShooterCommand);
        DeleteCommand = new RelayCommand<UiSession>(ExecuteDeleteCommand, CanExecuteDeleteCommand);
        CancelCommand = new RelayCommand<object>(ExecuteCancelCommand);
        SaveCommand = new RelayCommand<UiShooter>(ExecuteSaveCommand, CanExecuteSaveCommand);
        UiShooter selectedUiShooter = _events.FetchSelectedShooter();

        if (selectedUiShooter != null)
        {
          ShooterNumber = string.Format("{0}", selectedUiShooter.ShooterNumber);
          ExecuteSearchShooterCommand(ShooterNumber);
        }
      }
    }
    public ShooterEditViewModel()
    {
            AddToAssingedParticipationCommand = new RelayCommand<ParticipationListItem>(ExecuteAddToAssignedParticipationCommand,
        CanExecuteAddtoAssignedParticipationCommand);
      RemoveFromAssingedParticipationCommand =
        new RelayCommand<ShooterParticipationListItem>(ExecuteRemoveFromAssignedParticipationCommand,
          CanExecuteRemoveFromAssignedParticipationCommand);
      CancelCommand = new RelayCommand<object>(ExecuteCloseCommand);
      AssignShooterCollectionCommand = new RelayCommand<UiShooterCollection>(ExecuteAssignShooterCommand,
        CanExecuteAssignShooterCommand);

      if (!DesignTimeHelper.IsInDesignMode)
      {
        IConfiguration config = ConfigurationSource.Configuration;
        _participationDataStore = config.GetParticipationDataStore();
        _windowService = config.GetWindowService();
        _shooterParticipationDataStore = config.GetShooterParticipationDataStore();
        _collectionShooterDataStore = config.GetCollectionShooterDataStore();
        _personDataStore = config.GetPersonDataStore();
        _uiEvents = config.GetUIEvents();
        _uiEvents.ShooterSelected += shooter => { UiShooter = shooter; };
        _uiEvents.RequireSelectedShooter();
        _shooterNumberService = config.GetShooterNumberService();
        _shooterDataStore = config.GetShooterDataStore();
        _shooterParticipationView = config.GetShooterParticipationView();
        _shooterCollectionDataStore = config.GetShooterCollectionDataStore();
        _shooterCollectionParticipationDataStore = config.GetShooterCollectionParticipationDataStore();
        LoadData();

        UiShooterCollections = new ObservableCollection<UiShooterCollection>(_shooterCollectionDataStore.GetAll().Select(UiBusinessObjectMapper.ToUiShooterCollection).OrderBy(_ => _.CollectionName));
      }
    }
Example #10
0
 protected void ListenToPointerEvents()
 {
     UIEvents.AddListener(EPointerEvent.PointerDown, OnPointerDown);
     UIEvents.AddListener(EPointerEvent.DragStart, OnDragStart);
     UIEvents.AddListener(EPointerEvent.Drag, OnDrag);
     UIEvents.AddListener(EPointerEvent.DragEnd, OnDragStop);
 }
        public ShooterEditViewModel()
        {
            AddToAssingedParticipationCommand = new RelayCommand <ParticipationListItem>(ExecuteAddToAssignedParticipationCommand,
                                                                                         CanExecuteAddtoAssignedParticipationCommand);
            RemoveFromAssingedParticipationCommand =
                new RelayCommand <ShooterParticipationListItem>(ExecuteRemoveFromAssignedParticipationCommand,
                                                                CanExecuteRemoveFromAssignedParticipationCommand);
            CancelCommand = new RelayCommand <object>(ExecuteCloseCommand);
            AssignShooterCollectionCommand = new RelayCommand <UiShooterCollection>(ExecuteAssignShooterCommand,
                                                                                    CanExecuteAssignShooterCommand);

            if (!DesignTimeHelper.IsInDesignMode)
            {
                IConfiguration config = ConfigurationSource.Configuration;
                _participationDataStore        = config.GetParticipationDataStore();
                _windowService                 = config.GetWindowService();
                _shooterParticipationDataStore = config.GetShooterParticipationDataStore();
                _collectionShooterDataStore    = config.GetCollectionShooterDataStore();
                _personDataStore               = config.GetPersonDataStore();
                _uiEvents = config.GetUIEvents();
                _uiEvents.ShooterSelected += shooter => { UiShooter = shooter; };
                _uiEvents.RequireSelectedShooter();
                _shooterNumberService       = config.GetShooterNumberService();
                _shooterDataStore           = config.GetShooterDataStore();
                _shooterParticipationView   = config.GetShooterParticipationView();
                _shooterCollectionDataStore = config.GetShooterCollectionDataStore();
                _shooterCollectionParticipationDataStore = config.GetShooterCollectionParticipationDataStore();
                LoadData();

                UiShooterCollections = new ObservableCollection <UiShooterCollection>(_shooterCollectionDataStore.GetAll().Select(UiBusinessObjectMapper.ToUiShooterCollection).OrderBy(_ => _.CollectionName));
            }
        }
    private IEnumerator TimeToStartMinigame(Interactable interactable, float time, int index)
    {
        bool startedCountdown = false;

        while (time > 0)
        {
            // Stop countdown if player has started the minigame
            if (interactable.MinigameStarted)
            {
                interactable.MinigameStarted = false;
                yield break;
            }

            if (time <= 5.5 && !startedCountdown)
            {
                startedCountdown = true;
                UIEvents.StartFlickering(interactable.minigame);
            }

            time -= Time.deltaTime;
            yield return(null);
        }

        print("request expired " + interactable.minigame);
        float sanityAmount = MinigameManager.Instance.GetMinigameOfType(interactable.minigame).sanityLoss;

        GameManager.Instance.Sanity += sanityAmount;
        UIEvents.SanityUpdate(GameManager.Instance.Sanity);
        UIEvents.EndRequest(interactable.minigame);
        interactable.SetInteractable(false);
    }
Example #13
0
    public void Unsubscribe(UIEvents eventType, Action <object> callback)
    {
        List <Action <object> > subs;

        if (subscribers.ContainsKey(eventType) == false)
        {
            Debug.LogError("we tried to unsubscribe from a dictionary non entry");
            return;
        }
        if (subscribers[eventType] == null)
        {
            Debug.LogError("we tried to unsubscribe from a null list");
        }

        if (subscribers.TryGetValue(eventType, out subs))
        {
            for (int i = subscribers[eventType].Count - 1; i >= 0; i--)
            {
                if (subscribers[eventType][i] == callback)
                {
                    subscribers[eventType].RemoveAt(i);
                }
            }
        }
    }
Example #14
0
    private void MinigameFinished(IMinigame minigame, bool win)
    {
        print("Destroyed");
        minigame.DestroyMinigame();

        Minigame minigameValues = GetMinigameOfType(minigame.minigame);
        float    sanityAmount;

        if (win)
        {
            sanityAmount = minigameValues.sanityGain;
        }
        else
        {
            sanityAmount = minigameValues.sanityLoss;
        }
        currentInteractable.InMinigame = false;

        Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);

        GameManager.Instance.FreezeGame = false;
        GameManager.Instance.Sanity    += sanityAmount;
        UIEvents.EndRequest(minigame.minigame);
        UIEvents.SanityUpdate(GameManager.Instance.Sanity);
    }
    public void RequestMinigame()
    {
        Minigame minigame = RollMinigame();

        var interactables = GetAllAvailableInteractablesForMinigame(minigame.MinigameType);

        // second roll
        if (interactables.Count == 0)
        {
            minigame      = RollMinigame();
            interactables = GetAllAvailableInteractablesForMinigame(minigame.MinigameType);

            if (interactables.Count == 0)
            {
                return;
            }
        }

        int          randomInteractible = Random.Range(0, interactables.Count);
        Interactable interactable       = interactables[randomInteractible];

        interactable.SetInteractable(true);

        print("Dispalying minigame" + minigame.MinigameType);
        UIEvents.DisplayRequest(minigame.MinigameType);
        StartCoroutine(TimeToStartMinigame(interactable, minigame.timeToStart, randomInteractible));
    }
Example #16
0
 // Called from Dialogue System after beginning day dialogue
 public void DialogueEnded()
 {
     UIEvents.StartTimer();
     UIEvents.ToggleDialogueUI(false);
     FreezeGame = false;
     DayStarted = true;
 }
Example #17
0
    // Called from Dialogue System after end of day dialogue
    public void EndDay()
    {
        UIEvents.FadeToBlack();
        UIEvents.ToggleDialogueUI(false);

        Invoke("NextDay", 3f);
    }
    public static async Task <RegisterAccountResponse> TryToRegister()
    {
        var username   = Object.usernameInputField.GetValue();
        var playerName = Object.playerNameInputField.GetValue();
        var password   = Object.passwordInputField.GetValue();

        LOG.Log($"Trying to register with: {username} | {password} | {playerName}");

        var res = await NetworkService.Register(username, password, playerName);

        string message = "";

        switch (res.response)
        {
        case RegisterAccountResponseType.Success:
            message = $"Registration was ok!";
            break;

        case RegisterAccountResponseType.UserNameAlreadyExists:
            message = $"Username already exists";
            break;

        case RegisterAccountResponseType.PlayerNameAlreadyExists:
            message = $"Player name already exists";
            break;
        }

        LOG.Log(message);
        UIEvents.ChangeGameText(GameTextId.RegisterResponse, message);

        return(res);
    }
Example #19
0
        public EditPassViewModel()
        {
            if (!DesignTimeHelper.IsInDesignMode)
            {
                IConfiguration config = ConfigurationSource.Configuration;
                _shooterDatastore     = config.GetShooterDataStore();
                _sessionDatastore     = config.GetSessionDataStore();
                _programItemDatastore = config.GetProgramItemDataStore();
                _personDatastore      = config.GetPersonDataStore();
                _windowService        = config.GetWindowService();
                _events = config.GetUIEvents();

                List <UiShooter> shooters = _shooterDatastore.GetAll().Select(UiBusinessObjectMapper.ToUiShooter).ToList();
                shooters.ForEach(_ => { if (_.PersonId != null)
                                        {
                                            _.FetchPerson(_personDatastore.FindById((int)_.PersonId));
                                        }
                                 });
                UiShooters = new ObservableCollection <UiShooter>(shooters.OrderBy(_ => _.LastName).ThenBy(_ => _.FirstName));

                SearchShooterCommand = new RelayCommand <string>(ExecuteSearchShooterCommand, CanExecuteSearchShooterCommand);
                DeleteCommand        = new RelayCommand <UiSession>(ExecuteDeleteCommand, CanExecuteDeleteCommand);
                CancelCommand        = new RelayCommand <object>(ExecuteCancelCommand);
                SaveCommand          = new RelayCommand <UiShooter>(ExecuteSaveCommand, CanExecuteSaveCommand);
                UiShooter selectedUiShooter = _events.FetchSelectedShooter();

                if (selectedUiShooter != null)
                {
                    ShooterNumber = string.Format("{0}", selectedUiShooter.ShooterNumber);
                    ExecuteSearchShooterCommand(ShooterNumber);
                }
            }
        }
Example #20
0
 private static void SetZaiMessage()
 {
     if (!GameState.HasAnyCharacterType)
     {
         UIEvents.ChangeGameText(GameTextId.ZaiChat, "You don't have a Spirit Warrior on your vessel... Come and talk to me.");
     }
 }
 public DefaultConfiguration()
 {
   //_shootingRange = new SiusDataFileProvider(@"C:\Users\eberlid\Dropbox\SSC\2014\Herbstschiessen\ShootingRange\20140516_164043.log");
   //_shootingRange = new SiusDataFileProvider(@"C:\Users\eberlid\Documents\My Dropbox\SSC\2014\Herbstschiessen\ShootingRange\20140516_164043.log");
   //_shootingRange = new SiusDataFileProvider(@"C:\Users\eberlid\Dropbox\SSC\2014\Herbstschiessen\ShootingRange\20130914_132912.log");
   //_shootingRange = new SiusApiProvider("http://192.168.1.4");
   _shootingRange = new SiusDataSocketProvider("127.0.0.1", 4000);
   _events = new ShootingRangeEvents();
   _uiEvents = new UIEvents();
   ShootingRangeEntities entities = new ShootingRangeEntities();
   _personRepository = new PersonDataStore(entities);
   _shooterRepository = new ShooterDataStore(entities);
   _participationDataStore = new ParticipationDataStore(entities);
   _sessionDataStore = new SessionDataStore(entities);
   _shotDataStore = new ShotDataStore(entities);
   _sessionDetailsView = new SessionDetailsView(entities);
   _shooterNumberConfigDataStore = new ShooterNumberConfigDataStore(entities);
   _shooterParticipationDataStore = new ShooterParticipationDataStore(entities);
   _sessionSubtotalDataStore = new SessionSubtotalDataStore(entities);
   _programItemDataStore = new ProgramItemDataStore(entities);
   _groupMemberDetailsView = new GroupMemberDetailsView(entities);
   _groupDetailsView = new GroupDetailsView(entities);
   _shooterParticipationView = new ShooterParticipationView(entities);
   _windowService = new WindowService();
   _barcodePrintService = new PtouchBarcodePrinter();
   _barcodeBuilderService = new Barcode2Of5InterleavedService();
   _shooterNumberService = new ShooterNumberService(_shooterNumberConfigDataStore);
   _shooterCollectionParticipationDataStore = new ShooterCollectionParticipationDataStore(entities);
   _shooterCollectionDataStore = new ShooterCollectionDataStore(entities);
   _collectionShooterDataStore = new CollectionShooterDataStore(entities);
   _ssvShooterDataWriterService = new SsvFileWriter(@"C:\Sius\SiusData\SSVDaten\SSV_schuetzen.txt");
 }
    public MainViewModel()
    {
      if (DesignTimeHelper.IsInDesignMode)
      {
        _personDataStore = new FakePersonDataStore();
        _shooterDataStore = new FakeShooterDataStore();
        _participationDataStore = new FakeParticipationDataStore();
        _groupMemberDetailsView = new FakeGroupMemberDetailsView();
        _groupDetailsView = new FakeGroupDetailsView();
      }
      else
      {
        IConfiguration config = ConfigurationSource.Configuration;
        _personDataStore = config.GetPersonDataStore();
        _shooterDataStore = config.GetShooterDataStore();
        _participationDataStore = config.GetParticipationDataStore();
        _shooterParticipationDataStore = config.GetShooterParticipationDataStore();
        _groupMemberDetailsView = config.GetGroupMemberDetailsView();
        _shooterParticipationView = config.GetShooterParticipationView();
        _groupDetailsView = config.GetGroupDetailsView();
        _sessionDetailsView = config.GetSessionDetailsView();
        _shooterDataWriterService = config.GetSsvShooterDataWriterService();
        _collectionShooterDataStore = config.GetCollectionShooterDataStore();
        _shooterCollectionDataStore = config.GetShooterCollectionDataStore();
        _shooterCollectionParticipationDataStore = config.GetShooterCollectionParticipationDataStore();
        _shooterNumberService = config.GetShooterNumberService();
        _windowService = config.GetWindowService();
        _barcodePrintService = config.GetBarcodePrintService();
        _barcodeBuilderService = config.GetBarcodeBuilderService();
        _events = config.GetEvents();
        _uiEvents = config.GetUIEvents();
        _uiEvents.RequireSelectedPerson += () => _uiEvents.PersonSelected(SelectedUiPerson);
        _uiEvents.SelectPersonById += (id) => { SelectedUiPerson = UiPeople.FirstOrDefault(_ => _.PersonId == id); };
        _uiEvents.RequireSelectedShooter += () => _uiEvents.ShooterSelected(SelectedUiShooter);
        _uiEvents.FetchSelectedShooter += () => SelectedUiShooter;
        _uiEvents.PersonDataStoreChanged += LoadPersonList;
        _uiEvents.ShooterDataStoreChanged += LoadShooterList;
        _shooterNumberService.Configure(_shooterDataStore);

        LoadPersonList();
        LoadShooterList();
        LoadParticipationList();
      }

      CreatePersonCommand = new RelayCommand<object>(ExecuteCreatePersonCommand);
      EditPersonCommand = new RelayCommand<UiPerson>(ExecuteEditPersonCommand, CanExecuteEditPersonCommand);
      DeletePersonCommand = new RelayCommand<UiPerson>(ExecuteDeletePersonCommand, CanExecuteDeletePersonCommand);
      
      CreateShooterCommand = new RelayCommand<UiPerson>(ExecuteCreateShooterCommand, CanExecuteCreateShooterCommand);
      EditShooterCommand = new RelayCommand<UiShooter>(ExecuteEditShooterCommand, CanExecuteEditShooterCommand);
      DeleteShooterCommand = new RelayCommand<UiShooter>(ExecuteDeleteShooterCommand, CanExecuteDeleteShooterCommand);

      CreateParticipationCommand = new RelayCommand<object>(ExecuteCreateParticipationCommand);
      //EditParticipationCommand = new RelayCommand<UiParticipation>
      //DeleteParticipationCommand = new RelayCommand<UiParticipation>

      PrintBarcodeCommand = new RelayCommand<UiShooter>(ExecutePrintBarcodeCommand, CanExecutePrintBarcodeCommand);
      EditPassCommand = new RelayCommand<SessionDetails>(ExecuteEditPassCommand);
    }
Example #23
0
        public MainViewModel()
        {
            if (DesignTimeHelper.IsInDesignMode)
            {
                _personDataStore        = new FakePersonDataStore();
                _shooterDataStore       = new FakeShooterDataStore();
                _participationDataStore = new FakeParticipationDataStore();
                _groupMemberDetailsView = new FakeGroupMemberDetailsView();
                _groupDetailsView       = new FakeGroupDetailsView();
            }
            else
            {
                IConfiguration config = ConfigurationSource.Configuration;
                _personDataStore                         = config.GetPersonDataStore();
                _shooterDataStore                        = config.GetShooterDataStore();
                _participationDataStore                  = config.GetParticipationDataStore();
                _shooterParticipationDataStore           = config.GetShooterParticipationDataStore();
                _groupMemberDetailsView                  = config.GetGroupMemberDetailsView();
                _shooterParticipationView                = config.GetShooterParticipationView();
                _groupDetailsView                        = config.GetGroupDetailsView();
                _sessionDetailsView                      = config.GetSessionDetailsView();
                _shooterDataWriterService                = config.GetSsvShooterDataWriterService();
                _collectionShooterDataStore              = config.GetCollectionShooterDataStore();
                _shooterCollectionDataStore              = config.GetShooterCollectionDataStore();
                _shooterCollectionParticipationDataStore = config.GetShooterCollectionParticipationDataStore();
                _shooterNumberService                    = config.GetShooterNumberService();
                _windowService         = config.GetWindowService();
                _barcodePrintService   = config.GetBarcodePrintService();
                _barcodeBuilderService = config.GetBarcodeBuilderService();
                _events   = config.GetEvents();
                _uiEvents = config.GetUIEvents();
                _uiEvents.RequireSelectedPerson   += () => _uiEvents.PersonSelected(SelectedUiPerson);
                _uiEvents.SelectPersonById        += (id) => { SelectedUiPerson = UiPeople.FirstOrDefault(_ => _.PersonId == id); };
                _uiEvents.RequireSelectedShooter  += () => _uiEvents.ShooterSelected(SelectedUiShooter);
                _uiEvents.FetchSelectedShooter    += () => SelectedUiShooter;
                _uiEvents.PersonDataStoreChanged  += LoadPersonList;
                _uiEvents.ShooterDataStoreChanged += LoadShooterList;
                _shooterNumberService.Configure(_shooterDataStore);

                LoadPersonList();
                LoadShooterList();
                LoadParticipationList();
            }

            CreatePersonCommand = new RelayCommand <object>(ExecuteCreatePersonCommand);
            EditPersonCommand   = new RelayCommand <UiPerson>(ExecuteEditPersonCommand, CanExecuteEditPersonCommand);
            DeletePersonCommand = new RelayCommand <UiPerson>(ExecuteDeletePersonCommand, CanExecuteDeletePersonCommand);

            CreateShooterCommand = new RelayCommand <UiPerson>(ExecuteCreateShooterCommand, CanExecuteCreateShooterCommand);
            EditShooterCommand   = new RelayCommand <UiShooter>(ExecuteEditShooterCommand, CanExecuteEditShooterCommand);
            DeleteShooterCommand = new RelayCommand <UiShooter>(ExecuteDeleteShooterCommand, CanExecuteDeleteShooterCommand);

            CreateParticipationCommand = new RelayCommand <object>(ExecuteCreateParticipationCommand);
            //EditParticipationCommand = new RelayCommand<UiParticipation>
            //DeleteParticipationCommand = new RelayCommand<UiParticipation>

            PrintBarcodeCommand = new RelayCommand <UiShooter>(ExecutePrintBarcodeCommand, CanExecutePrintBarcodeCommand);
            EditPassCommand     = new RelayCommand <SessionDetails>(ExecuteEditPassCommand);
        }
Example #24
0
 public static void CallUIEvent(UIEvents eventID)
 {
     if (OnUIEvent != null)
     {
         OnUIEvent(eventID);
         Debug.Log("EventManager:" + eventID);
     }
 }
Example #25
0
    protected virtual void addEventsToList()
    {
        _showReadyEvent = UIEvents.Event(_UIType, UIEventEnum.SHOW_READY);
        _hideReadyEvent = UIEvents.Event(_UIType, UIEventEnum.HIDE_READY);

        addInterestedEvent(_showReadyEvent);
        addInterestedEvent(_hideReadyEvent);
    }
 public void OnBeginDrag(PointerEventData eventData)
 {
     if (!enabled)
     {
         return;
     }
     offset = Input.mousePosition - transformManager.transform.position;
     UIEvents.BeginCardDrag(card);
 }
Example #27
0
    void Awake()
    {
        _MenuList    = this.GetComponentsInChildren <UIMenu>();
        _menuIDStack = new Stack <UIDefine.Menu>();
        _gameplayHUD = this.GetComponentInChildren <GameplayHUD>();
        RegisterEvents();

        UIEvents.OPEN_MENU(UIDefine.Menu.MAIN);
    }
	void OnUIEvent(UIEvents identifier, IEntity entity)
	{
		if (!Entities.Contains(entity))
			return;

		var switcher = entity.GetComponent<SwitchSceneOnEventComponent>();

		if (switcher.UIEvent.HasAll(identifier))
			gameManager.LoadScene(switcher.Scene);
	}
Example #29
0
 private void Awake()
 {
     current = this;
     player  = new PlayerEvents();
     ui      = new UIEvents();
     spawn   = new SpawnEvents();
     level   = new LevelEvents();
     enemy   = new EnemyEvents();
     combat  = new CombatEvents();
 }
Example #30
0
    public virtual void OnDisable()
    {
        GameEvents.RemoveGameStateEnteredListener(DidEnterGameState);
        GameEvents.RemoveGameStateExitListener(WillExitGameState);

        UIEvents.RemoveListener(EPointerEvent.PointerDown, OnPointerDown);
        UIEvents.RemoveListener(EPointerEvent.DragStart, OnDragStart);
        UIEvents.RemoveListener(EPointerEvent.Drag, OnDrag);
        UIEvents.RemoveListener(EPointerEvent.DragEnd, OnDragStop);
    }
    public override void HandlerEvent(MessageArgs args)
    {
        int        window = args.opcode;
        UIEvents   uie    = (UIEvents)window;
        WindowBase wb     = ShowWindow(uie.ToString());

        string newline = "\r\n";

        Debug.Log("--------->>>>>> " + args.ma.ToString() + newline + args.opcode.ToString());
    }
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag(TagHelper.PLAYER_TAG))
        {
            GameObject tmp = Instantiate(priceSound);
            Destroy(tmp.gameObject, 2f);

            GameManager.Instance.Score++;
            UIEvents.OnScoreChangedFunction();
        }
    }
Example #33
0
 private void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(this);
     }
     else
     {
         Instance = this;
     }
 }
Example #34
0
 void InitAssigne()
 {
     for (int i = 0; i < transform.childCount; i++)
     {
         UIEvents ue = transform.GetChild(i).GetComponent <UIEvents>();
         if (ue)
         {
             ue.Init(AddContact(childitems[buttonnames[i]]));
         }
     }
 }
Example #35
0
    private void Awake()
    {
        this.RegisterBtn.onClick.AddListener(() => {
        });

        UIEvents.Listen(this.Forget.gameObject).onClick = (GameObject go) => {
        };

        this.LoginInBtn.onClick.AddListener(() => {
        });
    }
Example #36
0
    private void NextDay()
    {
        UIEvents.FadeToWhite();

        // Update Variables before next day
        //
        //
        Day++;

        Invoke("StartDay", 3f);
    }
	void OnEvent(UIEvents identifier, IEntity entity)
	{
		if (!Entities.Contains(entity))
			return;

		var concentrate = entity.GetComponent<ConcentrateOnHoldComponent>();

		if (identifier == UIEvents.OnPointerEnter)
			concentrate.Hovering = true;
		else if (identifier == UIEvents.OnPointerExit)
			concentrate.Hovering = false;
		else if (identifier == UIEvents.OnPointerDown)
			concentrate.Clicking = true;
		else if (identifier == UIEvents.OnPointerUp)
			concentrate.Clicking = false;
	}
    public PersonEditViewModel()
    {
      EditPersonCommand = new RelayCommand<UiPerson>(ExecuteEditPersonCommand, CanExecuteEditPersonCommand);
      CancelCommand = new RelayCommand<object>(ExecuteCloseCommand);
      //CreateShooterCommand = new RelayCommand<UiPerson>(ExecuteCreateShooterCommand, CanExecuteCreateShooterCommand);

      if (!DesignTimeHelper.IsInDesignMode)
      {
        IConfiguration config = ConfigurationSource.Configuration;
        _personDataStore = config.GetPersonDataStore();
        _shooterDataStore = config.GetShooterDataStore();
        _uiEvents = config.GetUIEvents();
        _windowService = config.GetWindowService();
        _shooterNumberService = config.GetShooterNumberService();
        _uiEvents.PersonSelected += person => { UiPerson = person ?? new UiPerson(); };
        _uiEvents.RequireSelectedPerson();
      }
    }
    public PersonCreateViewModel()
    {
      CreatePersonCommand = new RelayCommand<UiPerson>(ExecuteCreatePersonCommand, CanExecuteCreatePersonCommand);
      CancelCommand = new RelayCommand<object>(ExecuteCloseCommand);
      //CreateShooterCommand = new RelayCommand<UiPerson>(ExecuteCreateShooterCommand, CanExecuteCreateShooterCommand);
      //InscribeCompetitionCommand = new RelayCommand<UiShooter>(ExecuteInscribeCompetitionCommand, CanExecuteInscribeCompoetitionCommand);

      if (!DesignTimeHelper.IsInDesignMode)
      {
        IConfiguration config = ConfigurationSource.Configuration;
        _personDataStore = config.GetPersonDataStore();
        _shooterDataStore = config.GetShooterDataStore();
        _uiEvents = config.GetUIEvents();
        _windowService = config.GetWindowService();
        //_shooterNumberService = config.GetShooterNumberService();
      }

      UiPerson = new UiPerson();
    }
Example #40
0
 public void AddNewUIEvent(UIEvents type, string name)
 {
     UIEventEntry newEvent = new UIEventEntry();
     newEvent.Event = type;
     newEvent.time = DateTime.Now;
     newEvent.userName = name;
     UIEntries.Add(newEvent);
 }
        void SendMessage(UIEvents uiEvent, BaseEventData eventData)
        {
            for (int i = 0; i < Messages.Length; i++)
            {
                var message = Messages[i];

                if (Active && Entity != null && (message.Events & uiEvent) != 0)
                    Entity.SendMessage(message.Message, eventData);
            }
        }