コード例 #1
0
 public GameArgument(ComplexArgument arg)
 {
     if (arg.Value.Type == JTokenType.String)
     {
         simpleValue  = arg.Value.ToObject <string>();
         complexValue = null;
     }
     else
     {
         complexValue = new GameArguments(arg.Value.ToObject <JToken[]>());
         simpleValue  = null;
     }
     Rules = arg.Rules == null ? new MCRule[0] : arg.Rules;
 }
コード例 #2
0
        private GameArguments getArguments(string id)
        {
            GameArguments args = new GameArguments();

            if (InheritsFrom != null)
            {
                args += getLoadedVersionManifest(InheritsFrom).getArguments(id);
            }
            if (DescribedBy.ComplexArguments.ContainsKey(id))
            {
                args += new GameArguments(DescribedBy.ComplexArguments[id]);
            }
            if (args.Arguments.Length == 0)
            {
                throw new MCDownloadException("Argument type \"" + id + "\" doesn't have any arguments!");
            }
            return(args);
        }