GraphNode.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System;
  2. using System.Collections.Generic;
  3. namespace DunGen.Graph
  4. {
  5. /// <summary>
  6. /// Possible types of node. Currently used to prevent start & goal nodes from being moved/deleted
  7. /// </summary>
  8. public enum NodeType
  9. {
  10. Normal,
  11. Start,
  12. Goal,
  13. }
  14. /// <summary>
  15. /// A node on the dungeon flow graph, representing a single tile
  16. /// </summary>
  17. [Serializable]
  18. public class GraphNode
  19. {
  20. public DungeonFlow Graph;
  21. /// <summary>
  22. /// A collection of tile sets from which one tile will be chosen at random to place at the current position in the dungeon
  23. /// </summary>
  24. public List<TileSet> TileSets = new List<TileSet>();
  25. /// <summary>
  26. /// The node type (see NodeType description)
  27. /// </summary>
  28. public NodeType NodeType;
  29. /// <summary>
  30. /// The node's normalized position on the graph
  31. /// </summary>
  32. public float Position;
  33. /// <summary>
  34. /// A descriptive label, solely for visualization
  35. /// </summary>
  36. public string Label;
  37. /// <summary>
  38. /// A list of possible keys to be placed in this area
  39. /// </summary>
  40. public List<KeyLockPlacement> Keys = new List<KeyLockPlacement>();
  41. /// <summary>
  42. /// A list of possible locked doors to be placed in this area
  43. /// </summary>
  44. public List<KeyLockPlacement> Locks = new List<KeyLockPlacement>();
  45. /// <summary>
  46. /// Where locked doors are allowed to be placed on this node
  47. /// </summary>
  48. public NodeLockPlacement LockPlacement;
  49. /// <summary>
  50. /// Settings for straightening the path between this node and the next
  51. /// </summary>
  52. public PathStraighteningSettings StraighteningSettings = new PathStraighteningSettings();
  53. public GraphNode(DungeonFlow graph)
  54. {
  55. Graph = graph;
  56. }
  57. }
  58. }