@SuppressWarnings("unchecked")
    @Override
    public Actor put(Location loc, Actor obj) {
        if (loc instanceof AdvancedLocation) {// We only use advanced locations
// but
// the framework may put normal locations
            AdvancedLocation aloc = (AdvancedLocation) loc;
            switch (aloc.getLayer()) {
                case ActorLevel:
                    if (obj instanceof info.gridworld.actor.Actor) {
                        return super.put(aloc, obj);// Warning
                    } else {
                        throw new IllegalArgumentException();
                    }
                case FloorLevel:
                    if (obj instanceof info.gridworld.actor.Actor) {
                        return this.mapGrid.put(aloc, obj);
                    } else {
                        throw new IllegalArgumentException();
                    }
                case ObjectLevel:
                    if (obj instanceof info.gridworld.actor.Actor) {
                        return this.objectGrid.put(aloc, obj);
                    } else {
                        throw new IllegalArgumentException();
                    }
                default:
                    throw new IllegalArgumentException();
            }
        } else {
            if (obj instanceof info.gridworld.actor.Actor) {
                return super.put(loc, obj);// Warning
            } else {
                throw new IllegalArgumentException();
            }
        }
    }