using System.Collections; using System.Collections.Generic; using UnityEngine; using System; public class ChangeBaseDPClass : ICardEffect, IChangeBaseDPEffect { Func _changeDPFunc { get; set; } Func _permanentCondition { get; set; } Func _isUpDown { get; set; } Func _isMinusDP { get; set; } public void SetUpChangeBaseDPClass(Func changeDPFunc, Func permanentCondition, Func isUpDownFunc, Func isMinusDPFunc) { this._changeDPFunc = changeDPFunc; this._permanentCondition = permanentCondition; this._isUpDown = isUpDownFunc; this._isMinusDP = isMinusDPFunc; } public int GetDP(int DP, Permanent permanent) { if (_changeDPFunc != null) { if (permanent != null) { if (permanent.TopCard != null) { if (PermanentCondition(permanent)) { DP = _changeDPFunc(permanent, DP); } } } } return DP; } public bool PermanentCondition(Permanent permanent) { if (_permanentCondition != null) { return _permanentCondition(permanent); } return false; } public bool IsUpDown() { if (_isUpDown != null) { return _isUpDown(); } return false; } public bool IsMinusDP() { if (_isMinusDP != null) { return _isMinusDP(); } return false; } }