Пример #1
0
        public override void Execute()
        {
//			Logger.LogDebug("StartCommand","Execute");

            IGameApplication container = GameApplication.Instance;

            _gameStateModel.StartGame();

            //game controlelrs
            GameObject pGameControllers = UnityEngine.GameObject.Instantiate(Resources.Load("CocoMainController", typeof(GameObject))) as GameObject;

            pGameControllers.transform.parent = GameApplication.Instance.Transform;

            BackButtonService pBackButtonService = GameObject.FindObjectOfType <BackButtonService> ();

            injectionBinder.Bind <BackButtonService> ().ToValue(pBackButtonService).CrossContext();
        }
        public RentalValidation(IRentalApplication rental, IGameApplication game, IFriendApplication friend)
        {
            _rental = rental;
            _game   = game;
            _friend = friend;

            RuleFor(x => x.IdFriend)
            .NotEmpty().WithMessage("Amigo não foi informado.")
            .NotNull().WithMessage("Amigo não foi informado.")
            .Must(x => x > 0).WithMessage("Jogo não foi informado.")
            .Must(x => !FriendValid(x)).When(x => x.IdFriend != 0).WithMessage("Amigo não foi encontrado.");

            RuleFor(x => x.IdGame)
            .NotEmpty().WithMessage("Jogo não foi informado.")
            .NotNull().WithMessage("Jogo não foi informado.")
            .Must(x => x > 0).WithMessage("Jogo não foi informado.")
            .Must(x => !GameValid(x)).When(x => x.IdGame != 0).WithMessage("Jogo não foi encontrado.");

            RuleFor(x => x).Must(x => GameAvaliable(x.IdGame)).When(x => x.IdGame != 0).WithMessage("Jogo não está disponível.");
        }
Пример #3
0
        public GameValidation(IGameApplication game)
        {
            _game = game;

            RuleFor(x => x.Name)
            .MaximumLength(180).WithMessage("Nome não pode ser maior que 180 caracteres.")
            .NotEmpty().WithMessage("Nome não foi informado.")
            .NotNull().WithMessage("Nome não foi informado.");

            RuleFor(x => x.Description)
            .MaximumLength(1000).WithMessage("Nome não pode ser maior que 1000 caracteres.");

            RuleFor(x => x.Genre)
            .NotEmpty().WithMessage("Gênero não foi informado")
            .Must(x => GeneroValido(x)).WithMessage("Gênero informado não é válido.");

            RuleFor(x => x)
            .Must(x => !GetById(x.Id)).When(x => x.Id != 0).WithMessage("Jogo não encontrado.")
            .Must(x => !Existe(x)).WithMessage("Já possui um game cadastrado com esse nome.");
        }
Пример #4
0
        public static void Init(string initSceneName)
        {
            if (s_instance != null)
            {
                return;
            }

            if (initSceneName == null || initSceneName == "")
            {
                CoreLogger.LogDebug(LoggerModules.GameApplication, "request to init GameApplication synchronously");
                IGameApplication app = GameApplication.Instance;
                if (app == null)
                {
                    CoreLogger.LogCritical(LoggerModules.GameApplication, "failed to create GameApplication!");
                    return;
                }
            }

            s_requestingScene = Application.loadedLevelName;
            Application.LoadLevel(initSceneName);
        }
Пример #5
0
 /// <summary>
 /// 设置抽象层
 /// </summary>
 /// <param name="app"></param>
 public void SetApplication(IGameApplication app)
 {
     application = app;
 }
 public RentalController(IRentalApplication rental, IFriendApplication friend, IGameApplication game)
 {
     _rental = rental;
     _friend = friend;
     _game   = game;
 }
Пример #7
0
 public GameController(IGameApplication game) => _game = game;
Пример #8
0
        public MainContext(MonoBehaviour view) : base(view)
        {
            _container = GameApplication.Instance;

            StartStrange();
        }