2015-12-12 19:27:23 +00:00
|
|
|
|
using System;
|
2016-01-06 18:06:22 +00:00
|
|
|
|
using System.Runtime.CompilerServices;
|
2015-12-12 19:27:23 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MultiTheftAuto
|
|
|
|
|
{
|
|
|
|
|
public class Console : Player
|
|
|
|
|
{
|
2016-01-06 18:06:22 +00:00
|
|
|
|
private Console()
|
2015-12-12 19:27:23 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-06 18:06:22 +00:00
|
|
|
|
[MethodImpl( MethodImplOptions.InternalCall )]
|
|
|
|
|
public static extern bool Output( string text, Element element = null );
|
2015-12-12 19:27:23 +00:00
|
|
|
|
|
|
|
|
|
public static int Read()
|
|
|
|
|
{
|
|
|
|
|
return System.Console.Read();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static ConsoleKeyInfo ReadKey()
|
|
|
|
|
{
|
|
|
|
|
return System.Console.ReadKey();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static ConsoleKeyInfo ReadKey( bool intercept )
|
|
|
|
|
{
|
|
|
|
|
return System.Console.ReadKey( intercept );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string ReadLine()
|
|
|
|
|
{
|
|
|
|
|
return System.Console.ReadLine();
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-06 18:06:22 +00:00
|
|
|
|
[MethodImpl( MethodImplOptions.InternalCall )]
|
|
|
|
|
private static extern void Write( string message );
|
|
|
|
|
|
|
|
|
|
[MethodImpl( MethodImplOptions.InternalCall )]
|
|
|
|
|
private static extern void WriteLine( string message );
|
|
|
|
|
|
|
|
|
|
public static void Write( string message, params object[] args )
|
2015-12-12 19:27:23 +00:00
|
|
|
|
{
|
2016-01-06 18:06:22 +00:00
|
|
|
|
Write( String.Format( message, args ) );
|
2015-12-12 19:27:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-06 18:06:22 +00:00
|
|
|
|
public static void WriteLine( string message, params object[] args )
|
2015-12-12 19:27:23 +00:00
|
|
|
|
{
|
2016-01-06 18:06:22 +00:00
|
|
|
|
WriteLine( String.Format( message, args ) );
|
2015-12-12 19:27:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|