Move ChooseRandomEdgeCell from WorldUtils to Map

This commit is contained in:
Pavlos Touboulidis
2014-06-13 14:31:01 +03:00
parent 060d5326ed
commit 86febed0ce
7 changed files with 19 additions and 21 deletions

View File

@@ -55,18 +55,6 @@ namespace OpenRA
}
}
public static CPos ChooseRandomEdgeCell(this World w)
{
var isX = w.SharedRandom.Next(2) == 0;
var edge = w.SharedRandom.Next(2) == 0;
return new CPos(
isX ? w.SharedRandom.Next(w.Map.Bounds.Left, w.Map.Bounds.Right)
: (edge ? w.Map.Bounds.Left : w.Map.Bounds.Right),
!isX ? w.SharedRandom.Next(w.Map.Bounds.Top, w.Map.Bounds.Bottom)
: (edge ? w.Map.Bounds.Top : w.Map.Bounds.Bottom));
}
public static bool HasVoices(this Actor a)
{
var selectable = a.Info.Traits.GetOrDefault<SelectableInfo>();