20130313
[gdash.git] / src / cave / object / caveobjectrandomfill.hpp
blob14775f1949f4dfda2b15d2b02e21deb02df2a867
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_CAVEOBJECTRANDOMFILL
17 #define _GD_CAVEOBJECTRANDOMFILL
19 #include "config.h"
21 #include "cave/object/caveobject.hpp"
22 #include "cave/object/caveobjectrectangular.hpp"
24 /* RANDOM FILL OBJECT */
25 class CaveRandomFill : public CaveRectangular {
26 private:
27 GdElement replace_only;
28 GdBool c64_random;
30 GdIntLevels seed;
31 GdElement initial_fill;
32 GdElement random_fill_1; ///< Random fill element 1
33 GdInt random_fill_probability_1; ///< 0..255 "probability" of random fill element 1
34 GdElement random_fill_2; ///< Random fill element 2
35 GdInt random_fill_probability_2; ///< 0..255 "probability" of random fill element 2
36 GdElement random_fill_3; ///< Random fill element 3
37 GdInt random_fill_probability_3; ///< 0..255 "probability" of random fill element 3
38 GdElement random_fill_4; ///< Random fill element 4
39 GdInt random_fill_probability_4; ///< 0..255 "probability" of random fill element 4
40 public:
41 CaveRandomFill(Coordinate _p1, Coordinate _p2);
42 CaveRandomFill(): CaveRectangular(GD_RANDOM_FILL) {}
43 virtual void draw(CaveRendered &cave) const;
44 virtual CaveRandomFill *clone() const { return new CaveRandomFill(*this); };
45 void set_random_fill(GdElementEnum initial, GdElementEnum e1, GdElementEnum e2, GdElementEnum e3, GdElementEnum e4);
46 void set_random_prob(int i1, int i2, int i3, int i4);
47 void set_seed(int s1, int s2, int s3, int s4, int s5);
48 void set_c64_random(bool rand) { c64_random=rand; }
49 void set_replace_only(GdElementEnum repl) { replace_only=repl; }
50 virtual std::string get_bdcff() const;
51 virtual CaveRandomFill* clone_from_bdcff(const std::string &name, std::istream &is) const;
53 private:
54 static PropertyDescription const descriptor[];
56 public:
57 virtual PropertyDescription const* get_description_array() const;
59 virtual GdElementEnum get_characteristic_element() const { return O_NONE; }
60 virtual std::string get_description_markup() const;
64 #endif