Computed Properties

Computed properties is a property that does't wrap an actual field. The public MapLocation Location { get; set; } as it's written right now is really a field with getter and setter method.

The idea is rewrite the property so that it's computed each time the getter is called.

public MapLocation Location
{
    get
    {
        return _path.getLocationAt(_pathStep);
    }
}

Now, no matter what _pathStep is set to or when and where it's set, the location property will always accurately reflect the location of the invader.

results matching ""

    No results matching ""