Example #1
0
        protected virtual IEnumerable <JassGlobalDeclarationSyntax> RandomUnitTables(Map map)
        {
            if (map is null)
            {
                throw new ArgumentNullException(nameof(map));
            }

            var randomUnitTables = map.Info.RandomUnitTables;

            if (randomUnitTables is null)
            {
                yield break;
            }

            var id = 0;

            foreach (var randomUnitTable in randomUnitTables)
            {
                yield return(SyntaxFactory.GlobalArrayDeclaration(
                                 JassTypeSyntax.Integer,
                                 randomUnitTable.GetVariableName(id)));

                id++;
            }
        }