﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public class SceneObjectItem : BaseSceneItem
{
    [SerializeField]
    private int maxNumber = 1;

    [SerializeField]
    private bool randomPositionY;

    [SerializeField]
    private float respawnInterval = 1.0f;

    public int MaxNumber
    {
        get { return maxNumber;  }
    }


    public bool RandomPositionY
    {
        get { return randomPositionY; }
    }


    public float RespawnInterval
    {
        get { return respawnInterval; }
    }

    protected override Vector3 GetPosition(Vector3 currentPosition, Bounds bounds)
    {
        Vector3 position;

        if (randomPositionY)
        {
            position = new Vector3(
                Random.Range(bounds.min.x, bounds.max.x), Random.Range(bounds.min.y, bounds.max.y));
        } else
        {
            position = new Vector3(
                Random.Range(bounds.min.x, bounds.max.x), currentPosition.y);
        }

        return position;
    }
}
