ChangeCardLevelClass .cs 636 B

12345678910111213141516171819202122232425262728
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. public class ChangeCardLevelClass : ICardEffect, IChangeCardLevelEffect
  8. {
  9. Func<CardSource, int, int> GetLevel { get; set; } = null;
  10. public void SetUpChangeCardLevelClass(Func<CardSource, int, int> GetLevel)
  11. {
  12. this.GetLevel = GetLevel;
  13. }
  14. public int GetCardLevel(int level, CardSource card)
  15. {
  16. if (card != null)
  17. {
  18. if (GetLevel != null)
  19. {
  20. level = GetLevel(card, level);
  21. }
  22. }
  23. return level;
  24. }
  25. }