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: ; }
private void Select(JobTreeItemView item) { if (selectedItem != null) selectedItem.Selected = false; selectedItem = item; selectedItem.Selected = true; selectView.Select(selectedItem); previewView.Job = selectedItem.Job; }
public void Select(JobTreeItemView item) { selectedItem = item; }