Ejemplo n.º 1
0
        public virtual async Task Subscribe(IGameBase game)
        {
            var provider = base.GetStreamProvider("GameMessagesProvider");
            var stream   = provider.GetStream <GameMessage>(game.GetPrimaryKey(), "GameMessages");

            _gameMessageStream = await stream.SubscribeAsync(this);
        }
Ejemplo n.º 2
0
        private void MainMenu_GameChoosed(object sender, MainMenu.MenuEventArgs e)
        {
            if (e.GameNumber == 0)
            {
                currentGame = new TetrisGameA();
            }

            if (e.GameNumber == 1)
            {
                currentGame = new SnakeGameA();
            }

            currentGame.GameOver += GameOverHandler;
        }
Ejemplo n.º 3
0
        public virtual bool ShouldCastSpell(ref Enums.Spell spellCast, ref IGameBase spellTarget)
        {
            var result = false;

            if (Spells != null)
            {
                // If enemies are present

                if (CheckNBTLHostility())
                {
                }
                else
                {
                }
            }

            return(result);
        }
Ejemplo n.º 4
0
    protected override void OnClicked(Button sender)
    {
        base.OnClicked(sender);
        string   name = sender.name;
        GameItem gi   = sender.GetComponent <GameItem>();

        if (gi != null)
        {
            IGameBase gb = AppFacade.Ins.GetMgr <GameManager>().GetGame(gi.data.title);
            Debug.Log("onclicked name = " + gi.data.title);
            if (gb != null)
            {
                gb.StartUp();
            }
            return;
        }
        if (name.Contains("Setting"))
        {
        }
    }
Ejemplo n.º 5
0
        public virtual string GetDarkName(IGameBase target, ArticleType articleType, string nameType, bool upshift, bool groupCountOne)
        {
            string result = null;

            Debug.Assert(target != null);

            Debug.Assert(Enum.IsDefined(typeof(ArticleType), articleType));

            var artifact = target as IArtifact;

            if (artifact != null)
            {
                switch (articleType)
                {
                case ArticleType.None:

                    result = artifact.EvalPlural("unseen object", "unseen objects");

                    break;

                case ArticleType.A:
                case ArticleType.An:

                    result = artifact.EvalPlural("an unseen object", "unseen objects");

                    break;

                case ArticleType.Some:

                    result = artifact.EvalPlural("an unseen object", "some unseen objects");

                    break;

                case ArticleType.The:

                    result = artifact.EvalPlural("the unseen object", "the unseen objects");

                    break;
                }
            }
            else
            {
                var monster = target as IMonster;

                Debug.Assert(monster != null);

                switch (articleType)
                {
                case ArticleType.None:

                    result = groupCountOne ? "unseen entity" : monster.EvalPlural("unseen entity", "unseen entities");

                    break;

                case ArticleType.A:
                case ArticleType.An:

                    result = groupCountOne ? "an unseen entity" : monster.EvalPlural("an unseen entity", "unseen entities");

                    break;

                case ArticleType.Some:

                    result = groupCountOne ? "an unseen entity" : monster.EvalPlural("an unseen entity", "some unseen entities");

                    break;

                case ArticleType.The:

                    result = groupCountOne ? "the unseen entity" : monster.EvalPlural("the unseen entity", "the unseen entities");

                    break;
                }
            }

            if (upshift && result != null)
            {
                result = result.FirstCharToUpper();
            }

            return(result);
        }
Ejemplo n.º 6
0
        public virtual void PrintDoYouMeanObj1OrObj2(IGameBase obj1, IGameBase obj2)
        {
            Debug.Assert(obj1 != null && obj2 != null);

            gOut.Print("Do you mean \"{0}\" or \"{1}\"?", obj1.GetNoneName(showCharOwned: false), obj2.GetNoneName(showCharOwned: false, buf: Globals.Buf01));
        }
Ejemplo n.º 7
0
        public virtual void PrintCantVerbObj(IGameBase obj)
        {
            Debug.Assert(obj != null);

            gOut.Print("You can't {0} {1}.", Command.Verb, obj.GetTheName());
        }
Ejemplo n.º 8
0
 public virtual void PrintDoYouMeanObj1OrObj2(IGameBase obj1, IGameBase obj2)
 {
     CommandImpl.PrintDoYouMeanObj1OrObj2(obj1, obj2);
 }
Ejemplo n.º 9
0
 public virtual void PrintCantVerbObj(IGameBase obj)
 {
     CommandImpl.PrintCantVerbObj(obj);
 }
Ejemplo n.º 10
0
 public virtual string GetDarkName(IGameBase target, ArticleType articleType, string nameType, bool upshift, bool groupCountOne)
 {
     return(StateImpl.GetDarkName(target, articleType, nameType, upshift, groupCountOne));
 }
Ejemplo n.º 11
0
        public override void PrintCantVerbObj(IGameBase obj)
        {
            Debug.Assert(obj != null);

            gOut.Print("You stare at {0}, but you don't see any secret messages forming.", obj.GetTheName());
        }
Ejemplo n.º 12
0
 public virtual void PrintWhyAttack(IGameBase obj)
 {
     CommandImpl.PrintWhyAttack(obj);
 }
Ejemplo n.º 13
0
        public override void PrintCantVerbObj(IGameBase obj)
        {
            Debug.Assert(obj != null);

            gOut.Print("You can only {0} dead bodies.", Verb);
        }
Ejemplo n.º 14
0
 public virtual async Task Unsubscribe(IGameBase game)
 {
     await _gameMessageStream.UnsubscribeAsync();
 }
Ejemplo n.º 15
0
        public virtual void PrintWhyAttack(IGameBase obj)
        {
            Debug.Assert(obj != null);

            gOut.Print("Why would you attack {0}?", obj.GetTheName());
        }
Ejemplo n.º 16
0
 private void GameOverHandler(object sender, EventArgs e)
 {
     currentGame.GameOver -= GameOverHandler;
     currentGame           = new MainMenu();
 }