/// <summary> /// Try to merge its pattern with the pattern of the given bomb /// </summary> /// <param name="bomb">Bomb to merge with the object</param> /// <returns>Merge succeded or not</returns> public bool Merge(Bomb bomb, bool temp) { if (pattern_.MergePatterns(bomb.pattern_, temp)) { if (spriteCorrespondance_.ContainsKey(pattern_.SelectedType)) Tile = KaboomResources.Sprites[spriteCorrespondance_[pattern_.SelectedType]].Clone() as SpriteSheet; return true; } return false; }
/// <summary> /// Deleguate for explosion /// </summary> /// <param name="bomb">Bomb ready to boom</param> /// <param name="pos">Position of the bomb</param> public void ExplosionRuler(Bomb bomb, Point pos) { if (bomb == null) return; var t = new Rectangle(0, 0, this.SizeX, this.SizeY); foreach (var elt in bomb.GetPattern().Where(elt => t.Contains(new Point(pos.X + elt.Point.X, pos.Y + elt.Point.Y)))) { this.board_[pos.X + elt.Point.X, pos.Y + elt.Point.Y].Explode(elt.Time); } }