20130313
[gdash.git] / src / cave / object / caveobjectboundaryfill.hpp
blob5a9c55cc8ea786c252918f37760f6ba5c6cd3d7e
1 /*
2 * Copyright (c) 2007-2013, Czirkos Zoltan http://code.google.com/p/gdash/
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #ifndef _GD_CAVEOBJECTBOUNDARYFILL
17 #define _GD_CAVEOBJECTBOUNDARYFILL
19 #include "config.h"
21 #include "cave/object/caveobject.hpp"
22 #include "cave/object/caveobjectfill.hpp"
24 /// A cave objects which fills the inside of an area set by a border.
25 class CaveBoundaryFill : public CaveFill {
26 GdElement border_element; ///< The border of the area is this element.
27 void draw_proc(CaveRendered &cave, int x, int y) const;
29 public:
30 CaveBoundaryFill(Coordinate _start, GdElementEnum _border_element, GdElementEnum _fill_element);
31 CaveBoundaryFill(): CaveFill(GD_FLOODFILL_BORDER) {}
32 virtual CaveBoundaryFill *clone() const { return new CaveBoundaryFill(*this); }
33 virtual void draw(CaveRendered &cave) const;
34 virtual std::string get_bdcff() const;
35 virtual CaveBoundaryFill* clone_from_bdcff(const std::string &name, std::istream &is) const;
37 private:
38 static PropertyDescription const descriptor[];
40 public:
41 virtual PropertyDescription const* get_description_array() const;
43 virtual std::string get_description_markup() const;
47 #endif