2 * Copyright (c) 2007-2013, Czirkos Zoltan http://code.google.com/p/gdash/
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
19 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
20 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 #ifndef CAVEOBJECTRANDOMFILL_HPP_INCLUDED
24 #define CAVEOBJECTRANDOMFILL_HPP_INCLUDED
28 #include "cave/object/caveobject.hpp"
29 #include "cave/object/caveobjectrectangular.hpp"
31 /* RANDOM FILL OBJECT */
32 class CaveRandomFill
: public CaveRectangular
{
34 GdElement replace_only
;
38 GdElement initial_fill
;
39 GdElement random_fill_1
; ///< Random fill element 1
40 GdInt random_fill_probability_1
; ///< 0..255 "probability" of random fill element 1
41 GdElement random_fill_2
; ///< Random fill element 2
42 GdInt random_fill_probability_2
; ///< 0..255 "probability" of random fill element 2
43 GdElement random_fill_3
; ///< Random fill element 3
44 GdInt random_fill_probability_3
; ///< 0..255 "probability" of random fill element 3
45 GdElement random_fill_4
; ///< Random fill element 4
46 GdInt random_fill_probability_4
; ///< 0..255 "probability" of random fill element 4
48 CaveRandomFill(Coordinate _p1
, Coordinate _p2
);
49 CaveRandomFill(): CaveRectangular(GD_RANDOM_FILL
) {}
50 virtual void draw(CaveRendered
&cave
) const;
51 virtual CaveRandomFill
*clone() const;
52 void set_random_fill(GdElementEnum initial
, GdElementEnum e1
, GdElementEnum e2
, GdElementEnum e3
, GdElementEnum e4
);
53 void set_random_prob(int i1
, int i2
, int i3
, int i4
);
54 void set_seed(int s1
, int s2
, int s3
, int s4
, int s5
);
55 void set_c64_random(bool rand
) {
58 void set_replace_only(GdElementEnum repl
) {
61 virtual std::string
get_bdcff() const;
62 virtual CaveRandomFill
*clone_from_bdcff(const std::string
&name
, std::istream
&is
) const;
65 static PropertyDescription
const descriptor
[];
68 virtual PropertyDescription
const *get_description_array() const;
69 virtual std::string
get_description_markup() const;
70 virtual GdElementEnum
get_characteristic_element() const;