using ODMO.Commons.Enums;
using ODMO.Commons.Utils;
using System.Drawing;
namespace ODMO.Commons.Models.Character
{
public sealed partial class CharacterIncubatorModel
{
///
/// Inserts a new egg into the incubator.
///
public void InsertEgg(int eggId)
{
EggId = eggId;
HatchLevel = 0;
}
///
/// Removes the current egg from the incubator.
///
public void RemoveEgg()
{
EggId = 0;
HatchLevel = 0;
}
///
/// Inserts a new backup disk into the incubator.
///
public void InsertBackupDisk(int backupDiskId) => BackupDiskId = backupDiskId;
///
/// Removes the current backup disk from the incubator.
///
public void RemoveBackupDisk() => BackupDiskId = 0;
///
/// Increases the current incubator egg level.
///
public void IncreaseLevel() => HatchLevel += 1;
///
/// Returns the hatch size based on current egg level;
///
public short GetLevelSize()
{
return HatchLevel switch
{
3 => UtilitiesFunctions.RandomShort(8200, 10000),
4 => UtilitiesFunctions.RandomShort(11000, 12500),
5 => UtilitiesFunctions.RandomShort(11800, 13000),
_ => 0,
};
}
///
/// Returns the flag for perfect size based on the hatch grade.
///
/// Hatch grade enumeration
/// Hatch size
public bool PerfectSize(DigimonHatchGradeEnum grade, short size)
{
return grade switch
{
DigimonHatchGradeEnum.Default => size == 10000,
DigimonHatchGradeEnum.High => size == 12500,
DigimonHatchGradeEnum.Perfect => size == 13000,
_ => false
};
}
///
/// Flag for recent inserted egg.
///
public bool NotDevelopedEgg => EggId > 0 && HatchLevel == 0;
}
}