public void addField(int x, int y, Frame.FieldType type) { if (!(x < 0 || x >= Settings.MAP_SIZE || y < 0 || y >= Settings.MAP_SIZE || fieldArray[x, y] != null)) { fieldArray[x, y] = new Field(type); } }
public Field(Frame.FieldType fieldType) { this.explosive = null; this.mineDepth = 0.0; this.type = fieldType; if (this.type == Frame.FieldType.Scrap) { scrapImage = new Image(); this.scrapImage.Source = new BitmapImage(new Uri(@"pack://application:,,,/res/scrap.jpg")); } }