예제 #1
0
 void UpdateText(string newText)
 {
     previousText = Text;
     Text         = newText;
     if (IsVIsable)
     {
         Renderer.Write(emptyLine, Position);
     }
     emptyLine = Stringer.GetFilledString(newText.Length, ' ');
     Size      = new Int2(Text.Length, 1);
     Refresh();
 }
예제 #2
0
        static void DrawShips()
        {
            Int2 startPos = new Int2(36 + prepareMap.Size.x * 2, 1);

            for (int i = 0; i < ships.Length; i++)
            {
                if (ships[i] > 0)
                {
                    Renderer.Write(Stringer.GetFilledString(i * 2 + 2, "░░▒▒").PastelBg(Color.DarkGray).Pastel(Color.LightGray) + $" x{ships[i]}", startPos);
                    startPos.y += 2;
                }
            }
        }
예제 #3
0
        static void EraseShips()
        {
            Int2   startPos = new Int2(36 + prepareMap.Size.x * 2, 1);
            string shipStr;

            for (int i = 0; i < ships.Length; i++)
            {
                if (ships[i] > 0)
                {
                    shipStr = Stringer.GetFilledString(i * 2 + 2, ' ');
                    Renderer.Write($"{shipStr}     ", startPos);
                    startPos.y += 2;
                }
            }
        }
예제 #4
0
파일: Map.cs 프로젝트: Pimpeczek/Kajaki
 void SetupLines()
 {
     waterLine      = Stringer.GetFilledString(contentSize.x * 2, Bars.transparent[1]).Pastel(wavesColor).PastelBg(waterColor);
     emptyBoardLine = Stringer.GetFilledString(contentSize.x * 2, ' ');
     upBorder       = "██".Pastel(Color.Gold);
     for (int i = 0; i < contentSize.x; i++)
     {
         upBorder += "██".Pastel((i % 2 == 1 ? Color.Gray : Color.LightGray));
     }
     upBorder     += "██".Pastel(Color.Gold);
     midBorder     = new string[2];
     midBorder[0]  = "██".Pastel(Color.Gray) + emptyBoardLine + "██".Pastel(Color.Gray);
     midBorder[1]  = "██".Pastel(Color.LightGray) + emptyBoardLine + "██".Pastel(Color.LightGray);
     emptyLine     = Stringer.GetFilledString(size.x * 2, ' ');
     downBorder    = (string)upBorder.Clone();
     redrawBorders = true;
 }