public MainForm() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); // // TODO: Add constructor code after the InitializeComponent() call. // SpriteExtractor.LoadPalette(PaletteFname); SpriteExtractor.Yodesk = this.GetReader(); itemCollection = new ItemCollection(this.GetReader()); itemsForm = new ItemsForm(); itemsForm.SetCollection(itemCollection); int[] zoneOffsets = File.ReadAllLines(ZoneOffsetsFname).Select(s => int.Parse(s)).ToArray(); zonesForm = new ZonesForm(); zonesForm.SetThings(this.GetReader(), zoneOffsets); }
public void SetCollection(ItemCollection collection) { Collection = collection; lbItems.Items.Clear(); lbItems.Items.AddRange(Enumerable.Range(0, collection.Items.Length).Cast<object>().ToArray()); }