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); }
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; }
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); }
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")) { } }
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); }
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)); }
public virtual void PrintCantVerbObj(IGameBase obj) { Debug.Assert(obj != null); gOut.Print("You can't {0} {1}.", Command.Verb, obj.GetTheName()); }
public virtual void PrintDoYouMeanObj1OrObj2(IGameBase obj1, IGameBase obj2) { CommandImpl.PrintDoYouMeanObj1OrObj2(obj1, obj2); }
public virtual void PrintCantVerbObj(IGameBase obj) { CommandImpl.PrintCantVerbObj(obj); }
public virtual string GetDarkName(IGameBase target, ArticleType articleType, string nameType, bool upshift, bool groupCountOne) { return(StateImpl.GetDarkName(target, articleType, nameType, upshift, groupCountOne)); }
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()); }
public virtual void PrintWhyAttack(IGameBase obj) { CommandImpl.PrintWhyAttack(obj); }
public override void PrintCantVerbObj(IGameBase obj) { Debug.Assert(obj != null); gOut.Print("You can only {0} dead bodies.", Verb); }
public virtual async Task Unsubscribe(IGameBase game) { await _gameMessageStream.UnsubscribeAsync(); }
public virtual void PrintWhyAttack(IGameBase obj) { Debug.Assert(obj != null); gOut.Print("Why would you attack {0}?", obj.GetTheName()); }
private void GameOverHandler(object sender, EventArgs e) { currentGame.GameOver -= GameOverHandler; currentGame = new MainMenu(); }