Добавлен класс Console

This commit is contained in:
Kernell 2015-12-12 22:27:23 +03:00
parent 5e8456f986
commit a745ff12ed
2 changed files with 52 additions and 0 deletions

51
MultiTheftAuto/Console.cs Normal file
View File

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MultiTheftAuto
{
public class Console : Player
{
public Console( uint userdata ) :
base( userdata )
{
}
public static bool Output( string text, Element element = null )
{
return Native.Server.OutputConsole( text, element == null ? Element.Root.userdata : element.userdata );
}
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();
}
public static bool Write( string message, params string[] args )
{
return Native.Server.OutputServerLog( string.Format( message, args ) );
}
public static bool WriteLine( string message, params string[] args )
{
return Native.Server.OutputServerLog( string.Format( message, args ) );
}
}
}

View File

@ -50,6 +50,7 @@
<Compile Include="CameraMatrix.cs" /> <Compile Include="CameraMatrix.cs" />
<Compile Include="Color.cs" /> <Compile Include="Color.cs" />
<Compile Include="ColShape.cs" /> <Compile Include="ColShape.cs" />
<Compile Include="Console.cs" />
<Compile Include="Element.cs" /> <Compile Include="Element.cs" />
<Compile Include="Event.cs" /> <Compile Include="Event.cs" />
<Compile Include="EventArgs\BanEventArgs.cs" /> <Compile Include="EventArgs\BanEventArgs.cs" />