private int LayoutModuleRecursive(ModuleVM module, int row, int column)
        {
            this.SetRow(module, row);
            this.SetColumn(module, column);


            foreach (var unlock in module.Unlocks)
            {
                if (unlock.Target is UnlockedTankVM)
                {
                    this.SetRow(unlock.Target, row);
                    _isRowTerminated[row] = true;
                }
            }
        }
        private void LayoutModuleRecursive(ModuleVM module, RowInfo row)
        {
            row.AppendCell(module);

            var targets = module.Unlocks.Select(u => u.Target).ToArray();

            for (var i = 0; i < targets.Length; ++i)
            {
                var unlockedTarget = targets[i];

                if (i > 0)
                {
                    var newRow = this.NewRow();
                }

                if (unlockedTarget is UnlockedTankVM)
                {
                    row.SetUnlockedTank((UnlockedTankVM)unlockedTarget);
                }
                else
                {
                }
            }
        }
 private int LayoutModuleClass(ModuleVM rootModule)
 {
     ++_rowPointer;
     return(this.LayoutModuleRecursive(rootModule, _rowPointer, 0));
 }
Пример #4
0
 public UnlockedTankVM(Tank tank, ModuleVM unlockedBy)
 {
     this.UnlockedBy = unlockedBy;
     this.Row        = ModuleUnlockTargetVM.UndefinedRowOrColumn;
     this.Column     = ModuleUnlockTargetVM.UndefinedRowOrColumn;
 }