Draft virtual player strategy.
This commit is contained in:
44
Assets/Cryville/Crtr/Ruleset/VirtualPlayerStrategy.cs
Normal file
44
Assets/Cryville/Crtr/Ruleset/VirtualPlayerStrategy.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Cryville.Common;
|
||||
using Cryville.Common.Collections.Generic;
|
||||
using Cryville.Common.Pdt;
|
||||
using Cryville.Crtr.Extension;
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Cryville.Crtr.Ruleset {
|
||||
public class VirtualPlayerStrategy : MetaInfo {
|
||||
[JsonRequired]
|
||||
public long format;
|
||||
|
||||
[JsonRequired]
|
||||
public string ruleset;
|
||||
|
||||
[JsonIgnore]
|
||||
public PdtVirtualPlayerStrategy Root { get; private set; }
|
||||
|
||||
public void LoadPdt(DirectoryInfo dir) {
|
||||
using (StreamReader pdtreader = new StreamReader(dir.FullName + "/" + data + ".pdt", Encoding.UTF8)) {
|
||||
var src = pdtreader.ReadToEnd();
|
||||
Root = (PdtVirtualPlayerStrategy)new RulesetInterpreter(src, null).Interpret(typeof(PdtVirtualPlayerStrategy));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Binder(typeof(PdtBinder))]
|
||||
public class PdtVirtualPlayerStrategy {
|
||||
public Identifier[] use;
|
||||
public StrategyAction strategy;
|
||||
|
||||
public void Generate() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class StrategyAction {
|
||||
[ElementList]
|
||||
public PairList<RulesetSelectors, StrategyAction> Elements = new PairList<RulesetSelectors, StrategyAction>();
|
||||
[PropertyList]
|
||||
public PairList<ConstraintKey, PdtExpression> Properties = new PairList<ConstraintKey, PdtExpression>();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user