Prerequisites now uses the array-loading stuff in FieldLoader. It's use (in techtree) was also simplified.
This commit is contained in:
@@ -35,7 +35,7 @@ namespace OpenRa.Game.GameRules
|
|||||||
public readonly bool Invisible = false;
|
public readonly bool Invisible = false;
|
||||||
public readonly string Owner = "allies,soviet"; // TODO: make this an enum
|
public readonly string Owner = "allies,soviet"; // TODO: make this an enum
|
||||||
public readonly int Points = 0;
|
public readonly int Points = 0;
|
||||||
public readonly string Prerequisite = "";
|
public readonly string[] Prerequisite = new string[ 0 ];
|
||||||
public readonly string Primary = null;
|
public readonly string Primary = null;
|
||||||
public readonly string Secondary = null;
|
public readonly string Secondary = null;
|
||||||
public readonly int ROT = 0;
|
public readonly int ROT = 0;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using OpenRa.FileFormats;
|
using OpenRa.FileFormats;
|
||||||
using OpenRa.Game.GameRules;
|
using OpenRa.Game.GameRules;
|
||||||
|
|
||||||
@@ -38,11 +39,9 @@ namespace OpenRa.TechTree
|
|||||||
return race;
|
return race;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Tuple<string[],string[]> ParsePrerequisites(string prerequisites, string tag)
|
static Tuple<string[],string[]> ParsePrerequisites(string[] prerequisites, string tag)
|
||||||
{
|
{
|
||||||
List<string> allied = new List<string>(prerequisites.ToLowerInvariant().Split(
|
List<string> allied = prerequisites.Select( x => x.ToLowerInvariant() ).ToList();
|
||||||
new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
|
|
||||||
|
|
||||||
List<string> soviet = new List<string>(allied);
|
List<string> soviet = new List<string>(allied);
|
||||||
|
|
||||||
if (allied.Remove("stek"))
|
if (allied.Remove("stek"))
|
||||||
|
|||||||
Reference in New Issue
Block a user