Пример #1
0
        public override bool Equals(object other)
        {
            AdvanceableProduction p = (AdvanceableProduction)other;

            return(p.current == current && p.min == min && p.Max == Max &&
                   p.prod.Equals(this.prod));
        }
Пример #2
0
            public Enumerator(AdvanceableProduction prod)
            {
#if GATHERING_STATS
                InstanceCount++;
#endif
                min    = prod.Min;
                start  = prod.Min - 1;
                max    = prod.Max;
                target = prod.prod;
            }
Пример #3
0
        private string ToString0(AdvanceableProduction production)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("[{0} => ", Name);
            for (int i = 0; i < production.Min; i++)
            {
                sb.AppendFormat("{0} ", production[i]);
            }
            sb.Append("!");
            for (int i = production.Min; i < production.Position; i++)
            {
                sb.AppendFormat("{0} ", production[i]);
            }
            sb.Append("@");
            for (int i = production.Position; i < production.Max; i++)
            {
                sb.AppendFormat("{0} ", production[i]);
            }
            sb.AppendFormat(", {0}]", LookaheadSymbol);
            return(sb.ToString());
        }
Пример #4
0
 public AdvanceableProduction(AdvanceableProduction adv)
     : this(adv.Target, adv.Min)
 {
     current = adv.Position;
 }