Ejemplo n.º 1
0
 public PipeAction(IExpire <Pipe <PMAction> > e, IFlagable f, IEnumerable <string> flags) : base(e, f)
 {
     // Construct a Pipe for actions with the given flags.
     // Only use this constructor if you know what the above sentence means.
     // Reccomended use the explicit flag assignment constructor.
     this.addFlags(flags);
 }
Ejemplo n.º 2
0
    public AbstractPipe(IExpire <Pipe <T> > e, IFlagable f)
    {
        this.myExpire   = e;
        this.myFlagable = f;

        // TODO, consider providing this object with a better NocabName
        // than the default uuid from a NocabNamable.
        this.myNocabName = new NocabNameable(this);
    }
Ejemplo n.º 3
0
 // TODO: think of making a PipeSum constructor that takes in an IExpire<Pipe<int>> expireable
 public PipeSum(IExpire <Pipe <int> > e, IFlagable f, int delta) : base(e, f)
 {
     // You SHOULD either:
     // 1) Provide a flag in the optional flag field
     // 2) Use an IFlagable object that already has flags
     //    Failure to do either may cause problems of lost pipes/ memory leaks
     //
     // The flags are used by Pipeline objects to sort and manage them.
     // If you really don't want to use the flag parameter, pass in the FlagConstans.NO_FLAG const
     this.delta = delta;
 }
Ejemplo n.º 4
0
 public PipeAction(IExpire <Pipe <PMAction> > e,
                   IFlagable f,
                   string actionTypeFilter = "",
                   string targetSkill      = "",
                   string drainOrAdd       = "",
                   string dmgType          = "") : base(e, f)
 {
     if (actionTypeFilter != "")
     {
         this.addFlag(actionTypeFilter);
     }
     if (targetSkill != "")
     {
         this.addFlag(targetSkill);
     }
     if (drainOrAdd != "")
     {
         this.addFlag(drainOrAdd);
     }
     if (dmgType != "")
     {
         this.addFlag(dmgType);
     }
 }
Ejemplo n.º 5
0
    protected void abstractLoadJson(JsonObject jo)
    {
        if (!jo.ContainsKey("Type"))
        {
            throw new InvalidLoadType("Missing Type field, this is not valid json object");
        }
        if (jo["Type"] != _MyType)
        {
            throw new InvalidLoadType("JsonObject has invalid type: " + jo["Type"]);
        }

        // TODO: this is an abstract class. Should the CentralRegistry of NocabNamables
        // have a refrence to this abstraction? I guess, what happens if you try to cast
        // an abstract class as the (hopefully) correct base class? I guess everything should
        // still work out ok... Maybe?
        this.myNocabName = new NocabNameable(jo["NocabName"], this);

        this.myFlagable = new Flagable();
        this.myFlagable.loadJson(jo["Flags"]); // Load the JsonObject into myFlagable

        ExpireableFactory <Pipe <T> > expireFactory = new ExpireableFactory <Pipe <T> >();

        this.myExpire = expireFactory.fromJson(jo["Expire"]);
    }
 public void AddFlag(IFlagable flagable, Flag flag)
 {
     flagable.AddFlag(flag);
 }