コード例 #1
0
        public string GetTranscript(bool includeHeader)
        {
            if (MoveHistory.Count > 0)
            {
                StringBuilder sb = new StringBuilder();

                if (includeHeader)
                {
                    sb.AppendLine("[Volcanoes Saved Game Transcript v1]");
                    sb.AppendLine("[Date " + DateTime.Now.ToString("yyyy.MM.dd") + "]");
                    sb.AppendLine("");
                }

                if (Settings.IndicateTranscriptMoveType)
                {
                    var moves = GetDetailedMoveList();
                    sb.AppendLine(moves.Select(x => x.Tile + (x.Addition ? "+" : "")).Aggregate((c, n) => c + " " + n));
                }
                else
                {
                    sb.AppendLine(MoveHistory.Select(x => Constants.TileNames[x]).Aggregate((c, n) => c + " " + n));
                }

                return(sb.ToString());
            }

            return("");
        }
コード例 #2
0
ファイル: VolcanoGame.cs プロジェクト: skotz/volcanoes
        public string GetTranscriptLine()
        {
            if (MoveHistory.Count > 0)
            {
                if (Settings.IndicateTranscriptMoveType)
                {
                    var moves = GetDetailedMoveList();
                    return(moves.Select(x => x.Tile + (x.Addition ? "+" : "")).Aggregate((c, n) => c + " " + n));
                }
                else
                {
                    return(MoveHistory.Select(x => Constants.TileNames[x]).Aggregate((c, n) => c + " " + n));
                }
            }

            return("");
        }