Merge branch 'master' of manuel-voegele.de:inf3
This commit is contained in:
@@ -121,6 +121,24 @@ namespace WorldOfPeacecraft
|
|||||||
SenderBuffer.AddLine ("ask:say:" + message);
|
SenderBuffer.AddLine ("ask:say:" + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void moveUp()
|
||||||
|
{
|
||||||
|
SenderBuffer.AddLine("ask:mv:up");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void moveDown()
|
||||||
|
{
|
||||||
|
SenderBuffer.AddLine("ask:mv:dwn");
|
||||||
|
}
|
||||||
|
public void moveLeft()
|
||||||
|
{
|
||||||
|
SenderBuffer.AddLine("ask:mv:lft");
|
||||||
|
}
|
||||||
|
public void moveRight()
|
||||||
|
{
|
||||||
|
SenderBuffer.AddLine("ask:mv:rgt");
|
||||||
|
}
|
||||||
|
|
||||||
public void RefreshGui()
|
public void RefreshGui()
|
||||||
{
|
{
|
||||||
Gui.PerformRefresh();
|
Gui.PerformRefresh();
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ namespace WorldOfPeacecraft
|
|||||||
base.OnLayout (levent);
|
base.OnLayout (levent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void OnChatMessageSent (string message)
|
private void OnChatMessageSent (string message)
|
||||||
{
|
{
|
||||||
if (message.StartsWith ("/")) {
|
if (message.StartsWith ("/")) {
|
||||||
|
|||||||
@@ -16,6 +16,12 @@ namespace WorldOfPeacecraft
|
|||||||
|
|
||||||
void SendCommand (string command);
|
void SendCommand (string command);
|
||||||
|
|
||||||
|
void moveUp();
|
||||||
|
|
||||||
|
void moveDown();
|
||||||
|
void moveLeft();
|
||||||
|
void moveRight();
|
||||||
|
|
||||||
void StartThreads();
|
void StartThreads();
|
||||||
|
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace WorldOfPeacecraft
|
|||||||
{
|
{
|
||||||
Backend = backend;
|
Backend = backend;
|
||||||
this.Paint += DoPaint;
|
this.Paint += DoPaint;
|
||||||
|
this.PreviewKeyDown += board_KeyPress;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnLayout (LayoutEventArgs levent)
|
protected override void OnLayout (LayoutEventArgs levent)
|
||||||
@@ -27,6 +28,26 @@ namespace WorldOfPeacecraft
|
|||||||
base.OnLayout (levent);
|
base.OnLayout (levent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void board_KeyPress(object sender, PreviewKeyDownEventArgs e)
|
||||||
|
{
|
||||||
|
switch (e.KeyCode)
|
||||||
|
{
|
||||||
|
case Keys.A:
|
||||||
|
this.Backend.moveLeft();
|
||||||
|
break;
|
||||||
|
case Keys.D:
|
||||||
|
this.Backend.moveRight();
|
||||||
|
break;
|
||||||
|
case Keys.W:
|
||||||
|
this.Backend.moveUp();
|
||||||
|
break;
|
||||||
|
case Keys.S:
|
||||||
|
this.Backend.moveDown();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void DoPaint (object source, PaintEventArgs args)
|
public void DoPaint (object source, PaintEventArgs args)
|
||||||
{
|
{
|
||||||
BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate (this.CreateGraphics (), this.DisplayRectangle);
|
BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate (this.CreateGraphics (), this.DisplayRectangle);
|
||||||
|
|||||||
Reference in New Issue
Block a user