public InterfaceInputHandler(fbInterface ui) { this.ui = ui; game = ui.Game; engine = ui.Engine; new InputSubscriber(this) .Subscribe("move-nw") .Subscribe("move-n") .Subscribe("move-ne") .Subscribe("move-e") .Subscribe("move-se") .Subscribe("move-s") .Subscribe("move-sw") .Subscribe("move-w") .Subscribe("pass") .Subscribe("warp") .Subscribe("bombard") .Subscribe("dev-login") .Subscribe("dev-test") .Subscribe("dev-save") .Subscribe("dev-spawn-station") .Subscribe("dev-spawn-planet") .Subscribe("dev-spawn-playerstart") .Subscribe("select-next-idle") .Subscribe("quit") .Register(); }
protected override void Initialize() { base.Initialize(); SpriteBatch = new SpriteBatch(GraphicsDevice); Engine = new fbEngine(this); Engine.SetSize(1280, 720); LoadTexturesFromFile("cfg/textures.cfg"); Engine.DefaultFont = new Font(); Engine.DefaultFont.FontSheet = Engine.GetTexture("font"); Engine.DefaultFont.CharSize = new Vector2(8); NetMessage3.Setup(); Game = new fbGame(); Game.Ready = false; Game.SetupClientSideEventHandler(Engine); //eugh fbNetClient.Game = Game; UI = new fbInterface(Game, Engine); Engine.StartNetClient(); }
public TechProject( fbGame game, int owner, Station station, int length, TechID tech ) : base(game, owner, station, Tech.Techs[tech].Cost, length) { this.tech = tech; Prerequisites.AddRange(Tech.Techs[tech].Prerequisites); }
public fbWorld(fbGame game, int w, int h) { Game = game; Map = new fbMap(w, h); Players = new Dictionary <int, Player>(); Units = new Dictionary <int, Unit>(); PlayerUnits = new Dictionary <int, List <int> >(); PlayerStations = new Dictionary <int, List <int> >(); PlayerStarts = new List <Vector2i>(); }
protected Project( fbGame game, int owner, Station station, int cost, int length ) { Game = game; Owner = owner; Station = station; Cost = cost; Remaining = Length = length; finished = false; Prerequisites = new List <TechID>(); }
public BuildingProject( fbGame game, int owner, Station station, int length, UnitType unitType ) : base( game, owner, station, unitType.Cost, length ) { this.unitType = unitType; Prerequisites.AddRange(unitType.Prerequisites); }
public fbInterface( fbGame game, fbEngine engine ) { Game = game; Engine = engine; Camera = new fbCamera(engine); Widgets = new List <Widget>(); NamedWidgets = new Dictionary <string, Widget>(); DefaultTheme = new Theme( new ColorSet( Color.White, Color.White, Color.Gray ), new ColorSet( new Color(0, 0, 0, 0.6f), Color.DarkGray * 0.9f, Color.DarkGray * 0.7f ), new ColorSet( Color.White * 0.8f, Color.White * 0.8f, Color.White * 0.8f ) ); LoadUIFromXml("ui/main.xml"); EventHandler = (InterfaceEventHandler) new InterfaceEventHandler(game, this) .Subscribe(engine, EventType.NameEvent) .Subscribe(engine, EventType.BuildUnitEvent); new InterfaceInputHandler(this); }
public Unit( fbWorld world, UnitType unitType, int owner, int id, int x, int y ) { animateable = new Animateable(this); World = world; game = World.Game; UnitType = unitType; Owner = owner; ID = id; this.x = x; this.y = y; Moves = UnitType.Moves; Attacks = UnitType.Attacks; Strength = UnitType.Strength; }
public ServerGameEventHandler(fbGame game) : base(game) { fallthrough = new GameEventHandler(game, null); }
protected fbEventHandler(fbGame game) { Game = game; }
public InterfaceEventHandler(fbGame game, fbInterface ui) : base(game) { Game = game; this.ui = ui; }
public GameEventHandler(fbGame fbGame, fbEngine engine) : base(fbGame) { this.engine = engine; }