コード例 #1
0
            public Sky(Box bin, int spreadFactor, Box[] input)
            {
                this.skylines   = new LStack <Skyline>();
                this.backBuffer = new LStack <Skyline>();
                this.skylines.Add(new Skyline {
                    x    = 0,
                    h    = 0,
                    w    = bin.w,
                    rFit = bin.w,
                    lFit = bin.w,
                });
                this.binIndex = 0;
                this.bin      = bin;
                this.input    = input;
                this._toPack  = new LStack <int>(this.input.Length);
                for (int i = 0; i < this.input.Length; ++i)
                {
                    _toPack.Add(i);
                }

                this.packCandidates = new LStack <PackCandidate>();
                this.candComp       = new CandidateComparer(this);
                this.spreadFactor   = spreadFactor;
                this.lowestSky      = this.highestSky = 0;
            }
コード例 #2
0
 protected BaseCore(char letter, int durability)
 {
     Letter                 = letter;
     Durability             = durability;
     this.fragments         = new LStack();
     this.state             = State.Normal;
     this.initialDurability = durability;
 }
コード例 #3
0
ファイル: Core.cs プロジェクト: Ivolekov/SoftUni_3.0
 protected Core(CoreType coreType, int maxDurability)
 {
     nameIntValue++;
     this.coreType      = coreType;
     this.MaxDurability = maxDurability;
     this.fragments     = new LStack();
     this.Name          = (char)nameIntValue;
 }
コード例 #4
0
        public static void PopAll(LStack stk)
        {
            int num = stk.Pop();

            while (num > 0)
            {
                Console.Write(num + " ");
                num = stk.Pop();
            }
        }
コード例 #5
0
        public static void PrintAll(LStack stk)
        {
            var node = stk.Head;

            while (node != null)
            {
                Console.Write(node.Val + " ");
                node = node.Next;
            }
        }
コード例 #6
0
 protected BaseCore(string type, int durability, string name)
 {
     this.Type = type;
     this.Name = name;
     this.initialDurability = durability;
     this.Durability        = durability;
     this.fragments         = new LStack();
     this.state             = CoreState.NORMAL;
     this.pressureOnCore    = 0;
 }
コード例 #7
0
        public static LStack Create(int[] values)
        {
            var stk = new LStack();

            for (int i = 0; i < values.Length; i++)
            {
                stk.Push(values[i]);
            }

            return(stk);
        }
コード例 #8
0
 protected BaseCore(string name, int durability)
 {
     this.Name              = name;
     this.Durability        = durability;
     this.attachedFragments = new LStack <IFragment>();
 }
コード例 #9
0
 public void SetUp()
 {
     this.testStack = new LStack <IFragment>();
 }
コード例 #10
0
 public void Dispose()
 {
     source = null;
 }
コード例 #11
0
 public void TestInit()
 {
     this.collection = new LStack();
 }