using UnityEngine;
namespace UnityAtoms
{
///
/// Variable of type `int`. Inherits from `EquatableAtomVariable<int, IntEvent, IntIntEvent, IntIntFunction>`.
///
[EditorIcon("atom-icon-lush")]
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Int", fileName = "IntVariable")]
public sealed class IntVariable : EquatableAtomVariable
{
///
/// Add value to Variable.
///
/// Value to add.
public void Add(int value) => Value += value;
///
/// Add variable value to Variable.
///
/// Variable with value to add.
public void Add(AtomBaseVariable variable) => Add(variable.Value);
///
/// Subtract value from Variable.
///
/// Value to subtract.
public void Subtract(int value) => Value -= value;
///
/// Subtract variable value from Variable.
///
/// Variable with value to subtract.
public void Subtract(AtomBaseVariable variable) => Subtract(variable.Value);
///
/// Multiply variable by value.
///
/// Value to multiple by.
public void MultiplyBy(int value) => Value *= value;
///
/// Multiply variable by Variable value.
///
/// Variable with value to multiple by.
public void MultiplyBy(AtomBaseVariable variable) => MultiplyBy(variable.Value);
///
/// Divide Variable by value.
///
/// Value to divide by.
public void DivideBy(int value) => Value /= value;
///
/// Divide Variable by Variable value.
///
/// Variable value to divide by.
public void DivideBy(AtomBaseVariable variable) => DivideBy(variable.Value);
}
}