This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-07-07 21:48:23.057 mono[699:507] | |
No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting | |
/Users/thill/Projects/FNATestGame/FNATestGame/Info.plist | |
/Users/thill/Projects/FNATestGame/FNATestGame/bin/Debug/FNATestGame.app/Contents/Info.plist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Game | |
{ | |
Sdl2Graphics window; | |
public static void Main(string[] args) | |
{ | |
window = new Sdl2Graphics(new Size(450, 450)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Drawing; | |
using SDL2TestGame.RendererSDL2; | |
namespace SDL2TestGame | |
{ | |
public class Game | |
{ | |
static Sdl2Graphics window; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void DrawSomeRect() | |
{ | |
SDL.SDL_SetRenderDrawColor(renderer, 0, 175, 175, 0); | |
SDL.SDL_RenderClear(renderer); | |
var rectangle = new SDL.SDL_Rect(); | |
rectangle.x = rectangle.y = 50; | |
rectangle.w = rectangle.h = 50; | |
SDL.SDL_RenderDrawRect(renderer, ref rectangle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Copyright & License Information | |
/* | |
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS) | |
* This file is part of OpenRA, which is free software. It is made | |
* available to you under the terms of the GNU General Public License | |
* as published by the Free Software Foundation. For more information, | |
* see COPYING. | |
*/ | |
#endregion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var near = self.World.FindActorsInCircle(self.CenterPosition, info.Range); | |
foreach (var actor in near) | |
{ | |
var foo = actor.TraitOrDefault<FooBar>(); | |
if (foo == null) return; | |
// do stuff | |
} | |
var near = self.World.FindActorsInCircle(self.CenterPosition, info.Range) | |
.Where(a => a.HasTrait<FooBar>()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// existing code | |
Actor ChooseTarget(Actor self, WRange range) | |
{ | |
nextScanTime = self.World.SharedRandom.Next(info.MinimumScanTimeInterval, info.MaximumScanTimeInterval); | |
var inRange = self.World.FindActorsInCircle(self.CenterPosition, range); | |
return inRange | |
.Where(a => | |
a.AppearsHostileTo(self) && | |
!a.HasTrait<AutoTargetIgnore>() && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Copyright & License Information | |
/* | |
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS) | |
* This file is part of OpenRA, which is free software. It is made | |
* available to you under the terms of the GNU General Public License | |
* as published by the Free Software Foundation. For more information, | |
* see COPYING. | |
*/ | |
#endregion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ParaDropOrderGenerator : IOrderGenerator | |
{ | |
Actor self; | |
public ParaDropOrderGenerator(Actor self) { this.self = self; } | |
public IEnumerable<Order> Order(World world, CPos xy, MouseInput mi) | |
{ | |
if (mi.Button == Game.mouseButtonPreference.Action) | |
yield return new Order("DoParadrop", self, false) { TargetLocation = xy }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ParadropOrderTargeter : IOrderTargeter | |
{ | |
public bool CanTarget(Actor self, Target target, List<Actor> othersAtTarget, TargetModifiers modifiers, ref string cursor) | |
{ | |
if (target.Type != TargetType.Terrain) | |
return false; | |
var location = self.World.Map.CellContaining(target.CenterPosition); | |
if (!self.World.Map.Contains(location)) | |
return false; |