Replace CPos.CenterPosition -> Map.CenterOfCell.

This commit is contained in:
Paul Chote
2013-09-17 22:27:19 +12:00
parent b6d1d26eeb
commit 7b52fa52b6
48 changed files with 105 additions and 90 deletions

View File

@@ -23,11 +23,13 @@ namespace OpenRA.Mods.RA
class Immobile : IOccupySpace, ISync, INotifyAddedToWorld, INotifyRemovedFromWorld
{
[Sync] readonly CPos location;
[Sync] readonly WPos position;
readonly IEnumerable<Pair<CPos, SubCell>> occupied;
public Immobile(ActorInitializer init, ImmobileInfo info)
{
this.location = init.Get<LocationInit, CPos>();
location = init.Get<LocationInit, CPos>();
position = init.world.Map.CenterOfCell(location);
if (info.OccupiesSpace)
occupied = new [] { Pair.New(TopLeft, SubCell.FullCell) };
@@ -36,8 +38,8 @@ namespace OpenRA.Mods.RA
}
public CPos TopLeft { get { return location; } }
public WPos CenterPosition { get { return position; } }
public IEnumerable<Pair<CPos, SubCell>> OccupiedCells() { return occupied; }
public WPos CenterPosition { get { return location.CenterPosition; } }
public void AddedToWorld(Actor self)
{