示例#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);
 }
    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);
    }
示例#3
0
        private IExpire ToTimeExpire(ParElement ele)
        {
            IExpire expire = null;

            if (ele == null || (expire = (GenObject(ele.Type) as IExpire)) == null)
            {
                expire = new TimeExpire();
            }
            SetPars(ele.GetPars(), expire);
            return(expire);
        }
示例#4
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;
 }
示例#5
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);
     }
 }
    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"]);
    }
示例#7
0
 public MasterCard(string bankName, string holderName) : base(bankName, "MasterCard", holderName, 0, 19)
 {
     number     = GenerateCardNumber(prefixes);
     regNr      = "6942";
     expireDate = IExpire.MakeCardExpireDate(8, 5);
 }
示例#8
0
 public Maestro(string bankName, string holderName) : base(bankName, "Maestro", holderName, 0, 19)
 {
     number     = GenerateCardNumber(prefixes);
     regNr      = "1290";
     expireDate = IExpire.MakeCardExpireDate(8, 5);
 }
示例#9
0
 public Visa_Electron(string bankName, string holderName) : base(bankName, "Visa_E", holderName, 0, 19)
 {
     number     = GenerateCardNumber(prefixes);
     regNr      = "8902";
     expireDate = IExpire.MakeCardExpireDate(8, 5);
 }
示例#10
0
 public Dankort(string bankName, string holderName) : base(bankName, "Dankort", holderName, 0, 19)
 {
     number     = GenerateCardNumber(prefixes);
     regNr      = "8902";
     expireDate = IExpire.MakeCardExpireDate(8, 5);
 }