Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.12 KB | None | 0 0
  1. Sub Main
  2.     Dim subjects = Generate()
  3.        
  4.     For Each subject In subjects
  5.         Console.WriteLine(subject.ToString)
  6.     Next
  7. End Sub
  8.  
  9. Function Generate() As List(Of Subject)
  10.     Dim subjects = New List(Of Subject)
  11.    
  12.     For name = 0 To 11
  13.         For stone = 0 To 11
  14.             For archetype = 0 To 11
  15.                 For domain = 0 To 11
  16.                     Dim n As Name = name
  17.                     Dim s As Stone = stone
  18.                     Dim a As Archetype = archetype
  19.                     Dim d As Domain = domain
  20.                    
  21.                     If subjects.Where(Function(x) x.Name = n AndAlso x.Stone = s).Any Then Continue For
  22.                     If subjects.Where(Function(x) x.Name = n AndAlso x.Archetype = a).Any Then Continue For
  23.                     If subjects.Where(Function(x) x.Name = n AndAlso x.Domain = d).Any Then Continue For
  24.                     If subjects.Where(Function(x) x.Archetype = a AndAlso x.Domain = d).Any Then Continue For
  25.                     If subjects.Where(Function(x) x.Stone = s AndAlso x.Archetype = a).Any Then Continue For
  26.                     If subjects.Where(Function(x) x.Stone = s AndAlso x.Domain = d).Any Then Continue For
  27.                    
  28.                     subjects.Add(New Subject(n, s, a, d))
  29.                 Next
  30.             Next
  31.         Next
  32.     Next
  33.    
  34.     Return subjects
  35. End Function
  36.  
  37. Class Subject
  38.     Property Name As Name
  39.     Property Stone As Stone
  40.     Property Archetype As Archetype
  41.     Property Domain As Domain
  42.    
  43.     Sub New(name As Name, stone As Stone, archetype As Archetype, domain As Domain)
  44.         Me.Name = name
  45.         Me.Stone = stone
  46.         Me.Archetype = archetype
  47.         Me.Domain = domain
  48.     End Sub
  49.    
  50.     Shadows Function ToString() As String
  51.         Return Me.Name.ToString & ", the " & String.Join(" ", New String() {Me.Stone.ToString, Me.Domain.ToString, Me.Archetype.ToString})
  52.     End Function
  53. End Class
  54.  
  55. Enum Name As UShort
  56.     Kue
  57.     Mary
  58.     James
  59.     Lou
  60.     Brian
  61.     Jordan
  62.     Kate
  63.     Hiro
  64.     Matthew
  65.     Marco
  66.     Catherine
  67.     Nancy
  68. End Enum
  69.  
  70. Enum Stone As UShort
  71.     Garnet
  72.     Amethyst
  73.     Bloodstone
  74.     Diamond
  75.     Emerald
  76.     Moonstone
  77.     Ruby
  78.     Carnelian
  79.     Sapphire
  80.     Opal
  81.     Topaz
  82.     Turquoise
  83. End Enum
  84.  
  85. Enum Archetype As UShort
  86.     Sylph
  87.     Seer
  88.     Heir
  89.     Mage
  90.     Maid
  91.     Witch
  92.     Page
  93.     Knight
  94.     Rogue
  95.     Thief
  96.     Bard
  97.     Prince
  98. End Enum
  99.  
  100. Enum Domain As UShort
  101.     Time
  102.     Space
  103.     Hope
  104.     Rage
  105.     Heart
  106.     Mind
  107.     Breath
  108.     Blood
  109.     Doom
  110.     Life
  111.     Light
  112.     Void
  113. End Enum
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement