package com.openosrs.client.core;

/**
 * GroundItem - Represents an item on the ground.
 */
public class GroundItem {
    private final int itemId;
    private final int quantity;
    private final int x, y, plane;
    private final long spawnTime;
    private final long expireTime;
    
    public GroundItem(int itemId, int quantity, int x, int y, int plane) {
        this.itemId = itemId;
        this.quantity = quantity;
        this.x = x;
        this.y = y;
        this.plane = plane;
        this.spawnTime = System.currentTimeMillis();
        this.expireTime = spawnTime + (5 * 60 * 1000); // 5 minutes
    }
    
    public boolean isExpired() {
        return System.currentTimeMillis() > expireTime;
    }
    
    public int getId() { return itemId; }
    public int getItemId() { return itemId; }
    public int getQuantity() { return quantity; }
    public int getX() { return x; }
    public int getY() { return y; }
    public int getPlane() { return plane; }
    public long getSpawnTime() { return spawnTime; }
    public long getExpireTime() { return expireTime; }
    
    @Override
    public String toString() {
        return String.format("GroundItem[%d] x%d pos=(%d,%d,%d)", 
            itemId, quantity, x, y, plane);
    }
}