Пример #1
0
        public JobTreeView(GameScreen screen, List<Job> jobs)
            : base(screen)
        {
            items = new JobTreeItemView[jobs.Count/COLS+1, COLS];
            itemsForJob = new Dictionary<Job, JobTreeItemView>();

            int i = 0;
            for (int row = 0; row < items.GetLength(0); row++)
            {
                for (int col = 0; col < items.GetLength(1); col++)
                {
                    items[row, col] = itemsForJob[jobs[i]] = new JobTreeItemView(Screen, jobs[i], row, col);
                    if (++i >= jobs.Count)
                        goto END_CREAETE_ITEM;
                }
            }
            END_CREAETE_ITEM: ;
        }
Пример #2
0
 private void Select(JobTreeItemView item)
 {
     if (selectedItem != null)
         selectedItem.Selected = false;
     selectedItem = item;
     selectedItem.Selected = true;
     selectView.Select(selectedItem);
     previewView.Job = selectedItem.Job;
 }
Пример #3
0
 public void Select(JobTreeItemView item)
 {
     selectedItem = item;
 }