Skip to content

Commit 1f4b6fd

Browse files
committed
Update 2.0
1 parent 0fc0f09 commit 1f4b6fd

26 files changed

+5801
-926
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
/desktop.ini
12
.git/
3+
/.gitignore
24
obj/
35
bin/
4-
/nuget.config
6+
releases/
7+
/nuget.config
8+
docfx/

AshConsoleGraphics.cs

Lines changed: 29 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,39 @@
11
using System;
2-
using System.Drawing;
3-
using Pastel;
42
using System.Text;
53

6-
namespace AshConsoleGraphics
7-
{
8-
9-
public struct Col{
10-
int R;
11-
int G;
12-
int B;
13-
14-
public Col(int r, int g, int b){
15-
this.R = r;
16-
this.G = g;
17-
this.B = b;
18-
}
19-
20-
public Color toCol(){
21-
return Color.FromArgb(this.R, this.G, this.B);
22-
}
23-
24-
public static bool operator==(Col a, Col b)
25-
{
26-
return ((a.R == b.R) && (a.G == b.G) && (a.B == b.B));
27-
}
28-
29-
public static bool operator!=(Col a, Col b)
30-
{
31-
return !(a == b);
32-
}
33-
34-
public override string ToString()
35-
{
36-
return string.Format("R: {0}; G: {1}; B: {2}", R, G, B);
37-
}
4+
namespace AshConsoleGraphics;
385

39-
public override bool Equals(object? obj)
40-
{
41-
var objectToCompare = obj as Col?;
42-
if ( objectToCompare == null )
43-
return false;
6+
internal static class FastConsole{
7+
static readonly BufferedStream str;
448

45-
return this.ToString() == obj.ToString();
46-
}
9+
static FastConsole(){
10+
Console.OutputEncoding = Encoding.Unicode;
4711

48-
public override int GetHashCode()
49-
{
50-
return this.ToString().GetHashCode();
51-
}
12+
str = new BufferedStream(Console.OpenStandardOutput(), 0x15000);
5213
}
53-
54-
public static class FastConsole
55-
{
56-
static readonly BufferedStream str;
57-
58-
static FastConsole()
59-
{
60-
Console.OutputEncoding = Encoding.Unicode;
61-
62-
str = new BufferedStream(Console.OpenStandardOutput(), 0x15000);
63-
}
64-
65-
public static void Write(String s)
66-
{
67-
var rgb = new byte[s.Length << 1];
68-
Encoding.Unicode.GetBytes(s, 0, s.Length, rgb, 0);
69-
70-
lock (str) // (optional, can omit if appropriate)
71-
str.Write(rgb, 0, rgb.Length);
72-
}
73-
74-
public static void Flush() {
75-
lock (str) str.Flush(); }
14+
15+
public static void Write(String s){
16+
var rgb = new byte[s.Length << 1];
17+
Encoding.Unicode.GetBytes(s, 0, s.Length, rgb, 0);
18+
19+
lock (str) // (optional, can omit if appropriate)
20+
str.Write(rgb, 0, rgb.Length);
7621
}
7722

23+
public static void Flush() {
24+
lock (str) str.Flush(); }
25+
}
26+
27+
/// <summary>
28+
/// Elements that can work as connected lines
29+
/// </summary>
30+
public interface ILineElement{
31+
public BitBuffer GenerateBitBuffer();
32+
}
33+
34+
/// <summary>
35+
/// The relative placement of TuiElements respect to its parent Screen
36+
/// </summary>
37+
public enum Placement{
38+
Center, TopLeft, TopRight, BottomLeft, BottomRight, CenterLeft, CenterRight, TopCenter, BottomCenter
7839
}

AshConsoleGraphics.csproj

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
5+
56
<ImplicitUsings>enable</ImplicitUsings>
67
<Nullable>enable</Nullable>
8+
<LangVersion>preview</LangVersion>
9+
710
<PackageId>ashConsoleGraphics</PackageId>
8-
<Version>1.2.1</Version>
9-
<Authors>Dumbelfo</Authors>
11+
<Version>2.0.0</Version>
12+
<Authors>siljam</Authors>
1013
<Company>AshProject</Company>
14+
1115
<PackageDescription>GUIs and interfaces in your console</PackageDescription>
12-
<RepositoryUrl>https://github.com/Dumbelfo08/AshConsoleGraphics</RepositoryUrl>
16+
<RepositoryUrl>https://github.com/siljamdev/AshConsoleGraphics</RepositoryUrl>
17+
18+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1319
</PropertyGroup>
1420

1521
<ItemGroup>
16-
<PackageReference Include="Pastel" Version="4.1.0" />
22+
<PackageReference Include="AshLib" Version="3.2.2" />
23+
<Compile Remove="examples/**" />
1724
</ItemGroup>
1825

1926
</Project>

0 commit comments

Comments
 (0)