Beispiel #1
0
    public EnterAbility IsEnterable()
    {
        // Can't enter if movementcost is 0 (like a wall, machine, ect.)
        if (MovementCost == 0)
        {
            return(EnterAbility.Never);
        }

        // Check installedObject to see if it has a special block on it with special enter conditions
        // Has this tile a installedObject AND has the object a 'IsEnterable' func?
        if (InstalledObject != null && InstalledObject.IsEnterable != null)
        {
            return(InstalledObject.IsEnterable(InstalledObject));
        }

        // Otherwise tile is most likely enterable
        return(EnterAbility.Yes);
    }