slowly teasing the view+controller out of the model classes.

actually doesn't work right now, but that will change.

git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@2050 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
chrisf
2008-07-25 07:27:47 +00:00
parent 4ea033f63d
commit b594f296c3
16 changed files with 400 additions and 115 deletions

28
OpenRa.Game/Controller.cs Normal file
View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace OpenRa.Game
{
class Controller
{
Game game;
public IOrderGenerator orderGenerator;
public Controller(Game game)
{
this.game = game;
}
public void WorldClicked(object sender, MouseEventArgs e)
{
var xy = (1 / 24.0f) * (new float2(e.Location) + game.viewport.Location);
if (orderGenerator != null)
orderGenerator.Order(game, new int2((int)xy.X, (int)xy.Y)).Apply(game);
// todo: route all orders through netcode
}
}
}