public UpdateContainer Update() { if (mode_ != ModeType.ConfirmAgari && gameManager_.IsAgari) { preMode_ = mode_; mode_ = ModeType.ConfirmAgari; result_ = gameManager_.Result; } if (gameManager_.IsRyukyoku) { mode_ = ModeType.DisplayResult; result_ = null; } if (mode_ == ModeType.Riichi) { gameManager_.Dahai(13, false); } return(new UpdateContainer { DoraIndicators = gameManager_.DoraIndicators, Hand = gameManager_.Hand, Discards = gameManager_.Discards, Mode = mode_, Result = result_, TileCursor = tileCursor_ }); }
public void Reset() { gameManager_ = new GameManager(); tileCursor_ = new TileCursor(); mode_ = ModeType.Normal; preMode_ = ModeType.Normal; result_ = null; }
private static void PrintHandResult(TileIds tiles, TileId winTile, List <Meld> melds, HandResponse result) { Console.WriteLine($"{tiles.ToOneLineString()}"); var IsOpened = false; if (melds is null) { Console.WriteLine("鳴きなし"); } else { foreach (var meldItem in melds) { Console.WriteLine(meldItem); } IsOpened = melds.Count(x => x.Opened) > 0; } Console.WriteLine($"和了牌: {new TileIds(new List<TileId> { winTile }).ToOneLineString()}"); foreach (var yakuItem in result.Yaku) { var han = IsOpened ? yakuItem.HanOpen : yakuItem.HanClosed; Console.WriteLine($"{yakuItem.Japanese}\t{han}翻"); } Console.WriteLine($"{result.Han}翻 {result.Fu}符"); Console.WriteLine($"{result.Cost.Main}点"); foreach (var fuItem in result.FuDetailSet) { Console.WriteLine($"符: {fuItem.Fu}\tReason: {fuItem.Reason}"); } Console.WriteLine(""); }
public void CancelAgari() { mode_ = preMode_; gameManager_.IsAgari = false; result_ = null; }