Advertisement
dimon-torchila

Untitled

Mar 5th, 2023
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using Newtonsoft.Json;
  5. using Newtonsoft.Json.Linq;
  6. using UnityEditor.MPE;
  7. using UnityEngine;
  8.  
  9. public class LevelProcessor : MonoBehaviour, IEventProcessor
  10. {
  11. public LevelProcessor(JObject _levelInfo)
  12. {
  13. foreach (JObject req in _levelInfo["requirements"])
  14. {
  15. if (_levelInfo["requirements"][req][0].ToString() == "deliver_object")
  16. DeliveryRequirement1 DR1 = new DeliveryRequirement1(_levelInfo["requirement"][req].ToObject<DeliveryRequirement1>());
  17. if (_levelInfo["requirements"][req][0].ToString() == "score")
  18. DeliveryRequirement2 DR2 = new DeliveryRequirement2(_levelInfo["requirement"][req].ToObject<DeliveryRequirement2>());
  19. }
  20. }
  21.  
  22. public void ProcessEvent(GameEvent game_event)
  23. {
  24.  
  25. }
  26. }
  27.  
  28. class DeliveryRequirement1 : IEventProcessor
  29. {
  30. private string req_type;
  31. private string object_type;
  32. private int min_condition;
  33. private int _deliveryCount = 0;
  34.  
  35. public DeliveryRequirement1() { }
  36. public DeliveryRequirement1(string req_type, string object_type, int min_condition, int _deliveryCount)
  37. {
  38. this.req_type = req_type;
  39. this.object_type = object_type;
  40. this.min_condition = min_condition;
  41. this._deliveryCount = _deliveryCount;
  42. }
  43. public void ProcessEvent(GameEvent game_event)
  44. {
  45.  
  46. }
  47. }
  48. class DeliveryRequirement2 : IEventProcessor
  49. {
  50. private string object_type;
  51. private int _totalScore;
  52.  
  53. public DeliveryRequirement2()
  54. { }
  55.  
  56. public DeliveryRequirement2(string object_type, int _totalScore)
  57. {
  58. this.object_type = object_type;
  59. this._totalScore = _totalScore;
  60. }
  61. public void ProcessEvent(GameEvent game_event)
  62. {
  63.  
  64. }
  65. }
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement