package net.minecraft.world.entity.ai.sensing;

import com.google.common.collect.Lists;
import net.minecraft.world.entity.Entity;
import java.util.List;
import net.minecraft.world.entity.Mob;

public class Sensing {
    private final Mob mob;
    private final List<Entity> seen;
    private final List<Entity> unseen;
    
    public Sensing(final Mob aoz) {
        this.seen = Lists.newArrayList();
        this.unseen = Lists.newArrayList();
        this.mob = aoz;
    }
    
    public void tick() {
        this.seen.clear();
        this.unseen.clear();
    }
    
    public boolean canSee(final Entity aom) {
        if (this.seen.contains(aom)) {
            return true;
        }
        if (this.unseen.contains(aom)) {
            return false;
        }
        this.mob.level.getProfiler().push("canSee");
        final boolean boolean3 = this.mob.canSee(aom);
        this.mob.level.getProfiler().pop();
        if (boolean3) {
            this.seen.add(aom);
        }
        else {
            this.unseen.add(aom);
        }
        return boolean3;
    }
}
