Completed
Push — oop-api ( ea9bd3 )
by Kyle
01:48
created

sys_wait_for_event()   A

Complexity

Conditions 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 6
Bugs 0 Features 1
Metric Value
cc 1
c 6
b 0
f 1
dl 0
loc 15
rs 9.4285
1
"""This module handles backward compatibility with the ctypes libtcodpy module.
2
"""
3
4
from __future__ import absolute_import as _
5
6
import threading as _threading
7
8
from tcod.libtcod import *
0 ignored issues
show
Coding Style introduced by
The usage of wildcard imports like tcod.libtcod should generally be avoided.
Loading history...
Unused Code introduced by
BKGND_ALPHA was imported with wildcard, but is not used.
Loading history...
Unused Code introduced by
FOV_PERMISSIVE was imported with wildcard, but is not used.
Loading history...
Unused Code introduced by
BKGND_ADDALPHA was imported with wildcard, but is not used.
Loading history...
9
10
from tcod.tcod import _int, _cdata, _unpack_char_p
11
from tcod.tcod import _bytes, _unicode, _fmt_bytes, _fmt_unicode
12
from tcod.tcod import _CDataWrapper
13
from tcod.tcod import _PropagateException
14
from tcod.tcod import BSP as Bsp
15
from tcod.tcod import Key, Mouse, HeightMap, Console, Image
16
17
class ConsoleBuffer(object):
18
    """Simple console that allows direct (fast) access to cells. simplifies
19
    use of the "fill" functions.
20
21
    Args:
22
        width (int): Width of the new ConsoleBuffer.
23
        height (int): Height of the new ConsoleBuffer.
24
        back_r (int): Red background color, from 0 to 255.
25
        back_g (int): Green background color, from 0 to 255.
26
        back_b (int): Blue background color, from 0 to 255.
27
        fore_r (int): Red foreground color, from 0 to 255.
28
        fore_g (int): Green foreground color, from 0 to 255.
29
        fore_b (int): Blue foreground color, from 0 to 255.
30
        char (AnyStr): A single character str or bytes object.
31
    """
32
    def __init__(self, width, height, back_r=0, back_g=0, back_b=0, fore_r=0, fore_g=0, fore_b=0, char=' '):
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (108/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
33
        """initialize with given width and height. values to fill the buffer
34
        are optional, defaults to black with no characters.
35
        """
36
        n = width * height
0 ignored issues
show
Unused Code introduced by
The variable n seems to be unused.
Loading history...
37
        self.width = width
38
        self.height = height
39
        self.clear(back_r, back_g, back_b, fore_r, fore_g, fore_b, char)
40
41
    def clear(self, back_r=0, back_g=0, back_b=0, fore_r=0, fore_g=0, fore_b=0, char=' '):
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (90/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
42
        """Clears the console.  Values to fill it with are optional, defaults
43
        to black with no characters.
44
45
        Args:
46
            back_r (int): Red background color, from 0 to 255.
47
            back_g (int): Green background color, from 0 to 255.
48
            back_b (int): Blue background color, from 0 to 255.
49
            fore_r (int): Red foreground color, from 0 to 255.
50
            fore_g (int): Green foreground color, from 0 to 255.
51
            fore_b (int): Blue foreground color, from 0 to 255.
52
            char (AnyStr): A single character str or bytes object.
53
        """
54
        n = self.width * self.height
55
        self.back_r = [back_r] * n
56
        self.back_g = [back_g] * n
57
        self.back_b = [back_b] * n
58
        self.fore_r = [fore_r] * n
59
        self.fore_g = [fore_g] * n
60
        self.fore_b = [fore_b] * n
61
        self.char = [ord(char)] * n
62
63
    def copy(self):
64
        """Returns a copy of this ConsoleBuffer.
65
66
        Returns:
67
            ConsoleBuffer: A new ConsoleBuffer copy.
68
        """
69
        other = ConsoleBuffer(0, 0)
70
        other.width = self.width
71
        other.height = self.height
72
        other.back_r = list(self.back_r)  # make explicit copies of all lists
0 ignored issues
show
Coding Style introduced by
The attribute back_r was defined outside __init__.

It is generally a good practice to initialize all attributes to default values in the __init__ method:

class Foo:
    def __init__(self, x=None):
        self.x = x
Loading history...
73
        other.back_g = list(self.back_g)
0 ignored issues
show
Coding Style introduced by
The attribute back_g was defined outside __init__.

It is generally a good practice to initialize all attributes to default values in the __init__ method:

class Foo:
    def __init__(self, x=None):
        self.x = x
Loading history...
74
        other.back_b = list(self.back_b)
0 ignored issues
show
Coding Style introduced by
The attribute back_b was defined outside __init__.

It is generally a good practice to initialize all attributes to default values in the __init__ method:

class Foo:
    def __init__(self, x=None):
        self.x = x
Loading history...
75
        other.fore_r = list(self.fore_r)
0 ignored issues
show
Coding Style introduced by
The attribute fore_r was defined outside __init__.

It is generally a good practice to initialize all attributes to default values in the __init__ method:

class Foo:
    def __init__(self, x=None):
        self.x = x
Loading history...
76
        other.fore_g = list(self.fore_g)
0 ignored issues
show
Coding Style introduced by
The attribute fore_g was defined outside __init__.

It is generally a good practice to initialize all attributes to default values in the __init__ method:

class Foo:
    def __init__(self, x=None):
        self.x = x
Loading history...
77
        other.fore_b = list(self.fore_b)
0 ignored issues
show
Coding Style introduced by
The attribute fore_b was defined outside __init__.

It is generally a good practice to initialize all attributes to default values in the __init__ method:

class Foo:
    def __init__(self, x=None):
        self.x = x
Loading history...
78
        other.char = list(self.char)
0 ignored issues
show
Coding Style introduced by
The attribute char was defined outside __init__.

It is generally a good practice to initialize all attributes to default values in the __init__ method:

class Foo:
    def __init__(self, x=None):
        self.x = x
Loading history...
79
        return other
80
81
    def set_fore(self, x, y, r, g, b, char):
82
        """Set the character and foreground color of one cell.
83
84
        Args:
85
            x (int): X position to change.
86
            y (int): Y position to change.
87
            r (int): Red foreground color, from 0 to 255.
88
            g (int): Green foreground color, from 0 to 255.
89
            b (int): Blue foreground color, from 0 to 255.
90
            char (AnyStr): A single character str or bytes object.
91
        """
92
        i = self.width * y + x
93
        self.fore_r[i] = r
94
        self.fore_g[i] = g
95
        self.fore_b[i] = b
96
        self.char[i] = ord(char)
97
98
    def set_back(self, x, y, r, g, b):
99
        """Set the background color of one cell.
100
101
        Args:
102
            x (int): X position to change.
103
            y (int): Y position to change.
104
            r (int): Red background color, from 0 to 255.
105
            g (int): Green background color, from 0 to 255.
106
            b (int): Blue background color, from 0 to 255.
107
            char (AnyStr): A single character str or bytes object.
108
        """
109
        i = self.width * y + x
110
        self.back_r[i] = r
111
        self.back_g[i] = g
112
        self.back_b[i] = b
113
114
    def set(self, x, y, back_r, back_g, back_b, fore_r, fore_g, fore_b, char):
115
        """Set the background color, foreground color and character of one cell.
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (80/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
116
117
        Args:
118
            x (int): X position to change.
119
            y (int): Y position to change.
120
            back_r (int): Red background color, from 0 to 255.
121
            back_g (int): Green background color, from 0 to 255.
122
            back_b (int): Blue background color, from 0 to 255.
123
            fore_r (int): Red foreground color, from 0 to 255.
124
            fore_g (int): Green foreground color, from 0 to 255.
125
            fore_b (int): Blue foreground color, from 0 to 255.
126
            char (AnyStr): A single character str or bytes object.
127
        """
128
        i = self.width * y + x
129
        self.back_r[i] = back_r
130
        self.back_g[i] = back_g
131
        self.back_b[i] = back_b
132
        self.fore_r[i] = fore_r
133
        self.fore_g[i] = fore_g
134
        self.fore_b[i] = fore_b
135
        self.char[i] = ord(char)
136
137
    def blit(self, dest, fill_fore=True, fill_back=True):
138
        """Use libtcod's "fill" functions to write the buffer to a console.
139
140
        Args:
141
            dest (Console): Console object to modify.
142
            fill_fore (bool):
143
                If True, fill the foreground color and characters.
144
            fill_back (bool):
145
                If True, fill the background color.
146
        """
147
        dest = _cdata(dest)
148
        if (console_get_width(dest) != self.width or
149
            console_get_height(dest) != self.height):
150
            raise ValueError('ConsoleBuffer.blit: Destination console has an incorrect size.')
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (94/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
151
152
        if fill_back:
153
            lib.TCOD_console_fill_background(dest or ffi.NULL,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_fill_background.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
154
                                              ffi.new('int[]', self.back_r),
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
155
                                              ffi.new('int[]', self.back_g),
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
156
                                              ffi.new('int[]', self.back_b))
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
157
        if fill_fore:
158
            lib.TCOD_console_fill_foreground(dest or ffi.NULL,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_fill_foreground.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
159
                                              ffi.new('int[]', self.fore_r),
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
160
                                              ffi.new('int[]', self.fore_g),
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
161
                                              ffi.new('int[]', self.fore_b))
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
162
            lib.TCOD_console_fill_char(dest or ffi.NULL,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_fill_char.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
163
                                        ffi.new('int[]', self.char))
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
164
165
class Dice(_CDataWrapper):
166
    """
167
168
    Args:
169
        nb_dices (int): Number of dice.
170
        nb_faces (int): Number of sides on a die.
171
        multiplier (float): Multiplier.
172
        addsub (float): Addition.
173
174
    .. versionchanged:: 2.0
175
        This class now acts like the other CData wrapped classes
176
        and no longer acts like a list.
177
178
    .. deprecated:: 2.0
179
        You should make your own dice functions instead of using this class
180
        which is tied to a CData object.
181
    """
182
183
    def __init__(self, *args, **kargs):
184
        super(Dice, self).__init__(*args, **kargs)
185
        if self.cdata == ffi.NULL:
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
186
            self._init(*args, **kargs)
187
188
    def _init(self, nb_dices=0, nb_faces=0, multiplier=0, addsub=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
189
        self.cdata = ffi.new('TCOD_dice_t*')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
190
        self.nb_dices = nb_dices
191
        self.nb_faces = nb_faces
192
        self.multiplier = multiplier
193
        self.addsub = addsub
194
195
    def _get_nb_dices(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
196
        return self.nb_rolls
197
    def _set_nb_dices(self, value):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
198
        self.nb_rolls = value
0 ignored issues
show
Coding Style introduced by
The attribute nb_rolls was defined outside __init__.

It is generally a good practice to initialize all attributes to default values in the __init__ method:

class Foo:
    def __init__(self, x=None):
        self.x = x
Loading history...
199
    nb_dices = property(_get_nb_dices, _set_nb_dices)
200
201
    def __str__(self):
202
        add = '+(%s)' % self.addsub if self.addsub != 0 else ''
203
        return '%id%ix%s%s' % (self.nb_dices, self.nb_faces,
204
                               self.multiplier, add)
205
206
    def __repr__(self):
207
        return ('%s(nb_dices=%r,nb_faces=%r,multiplier=%r,addsub=%r)' %
208
                (self.__class__.__name__, self.nb_dices, self.nb_faces,
209
                 self.multiplier, self.addsub))
210
211
def bsp_new_with_size(x, y, w, h):
212
    """Create a new BSP instance with the given rectangle.
213
214
    Args:
215
        x (int): Rectangle left coordinate.
216
        y (int): Rectangle top coordinate.
217
        w (int): Rectangle width.
218
        h (int): Rectangle height.
219
220
    Returns:
221
        BSP: A new BSP instance.
222
223
    .. deprecated:: 2.0
224
       Call the :any:`BSP` class instead.
225
    """
226
    return Bsp(x, y, w, h)
227
228
def bsp_split_once(node, horizontal, position):
229
    """
230
    .. deprecated:: 2.0
231
       Use :any:`BSP.split_once` instead.
232
    """
233
    node.split_once('h' if horizontal else 'v', position)
234
235
def bsp_split_recursive(node, randomizer, nb, minHSize, minVSize, maxHRatio,
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
236
                        maxVRatio):
237
    node.split_recursive(nb, minHSize, minVSize,
238
                         maxHRatio, maxVRatio, randomizer)
239
240
def bsp_resize(node, x, y, w, h):
241
    """
242
    .. deprecated:: 2.0
243
       Use :any:`BSP.resize` instead.
244
    """
245
    node.resize(x, y, w, h)
246
247
def bsp_left(node):
248
    """
249
    .. deprecated:: 2.0
250
       Use :any:`BSP.get_left` instead.
251
    """
252
    return node.get_left()
253
254
def bsp_right(node):
255
    """
256
    .. deprecated:: 2.0
257
       Use :any:`BSP.get_right` instead.
258
    """
259
    return node.get_right()
260
261
def bsp_father(node):
262
    """
263
    .. deprecated:: 2.0
264
       Use :any:`BSP.get_parent` instead.
265
    """
266
    return node.get_parent()
267
268
def bsp_is_leaf(node):
269
    """
270
    .. deprecated:: 2.0
271
       Use :any:`BSP.is_leaf` instead.
272
    """
273
    return node.is_leaf()
274
275
def bsp_contains(node, cx, cy):
276
    """
277
    .. deprecated:: 2.0
278
       Use :any:`BSP.contains` instead.
279
    """
280
    return node.contains(cx, cy)
281
282
def bsp_find_node(node, cx, cy):
283
    """
284
    .. deprecated:: 2.0
285
       Use :any:`BSP.find_node` instead.
286
    """
287
    return node.find_node(cx, cy)
288
289
def _bsp_traverse(node, func, callback, userData):
290
    """pack callback into a handle for use with the callback
291
    _pycall_bsp_callback
292
    """
293
    with _PropagateException() as propagate:
294
        handle = ffi.new_handle((callback, userData, propagate))
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new_handle.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
295
        func(node.cdata, lib._pycall_bsp_callback, handle)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named _pycall_bsp_callback.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
296
297
def bsp_traverse_pre_order(node, callback, userData=0):
298
    """Traverse this nodes hierarchy with a callback.
299
300
    .. deprecated:: 2.0
301
       Use :any:`BSP.walk` instead.
302
    """
303
    _bsp_traverse(node, lib.TCOD_bsp_traverse_pre_order, callback, userData)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_bsp_traverse_pre_order.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
304
305
def bsp_traverse_in_order(node, callback, userData=0):
306
    """Traverse this nodes hierarchy with a callback.
307
308
    .. deprecated:: 2.0
309
       Use :any:`BSP.walk` instead.
310
    """
311
    _bsp_traverse(node, lib.TCOD_bsp_traverse_in_order, callback, userData)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_bsp_traverse_in_order.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
312
313
def bsp_traverse_post_order(node, callback, userData=0):
314
    """Traverse this nodes hierarchy with a callback.
315
316
    .. deprecated:: 2.0
317
       Use :any:`BSP.walk` instead.
318
    """
319
    _bsp_traverse(node, lib.TCOD_bsp_traverse_post_order, callback, userData)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_bsp_traverse_post_order.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
320
321
def bsp_traverse_level_order(node, callback, userData=0):
322
    """Traverse this nodes hierarchy with a callback.
323
324
    .. deprecated:: 2.0
325
       Use :any:`BSP.walk` instead.
326
    """
327
    _bsp_traverse(node, lib.TCOD_bsp_traverse_level_order, callback, userData)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_bsp_traverse_level_order.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
328
329
def bsp_traverse_inverted_level_order(node, callback, userData=0):
330
    """Traverse this nodes hierarchy with a callback.
331
332
    .. deprecated:: 2.0
333
       Use :any:`BSP.walk` instead.
334
    """
335
    _bsp_traverse(node, lib.TCOD_bsp_traverse_inverted_level_order,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_bsp_traverse_inverted_level_order.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
336
                  callback, userData)
337
338
def bsp_remove_sons(node):
339
    """Delete all children of a given node.  Not recommended.
340
341
    .. note::
342
       This function will add unnecessary complexity to your code.
343
       Don't use it.
344
345
    .. deprecated:: 2.0
346
       BSP deletion is automatic.
347
    """
348
    node._invalidate_children()
349
    lib.TCOD_bsp_remove_sons(node.cdata)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_bsp_remove_sons.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
350
351
def bsp_delete(node):
0 ignored issues
show
Unused Code introduced by
The argument node seems to be unused.
Loading history...
352
    """Exists for backward compatibility.  Does nothing.
353
354
    BSP's created by this library are automatically garbage collected once
355
    there are no references to the tree.
356
    This function exists for backwards compatibility.
357
358
    .. deprecated:: 2.0
359
       BSP deletion is automatic.
360
    """
361
    pass
362
363
def color_lerp(c1, c2, a):
364
    """Return the linear interpolation between two colors.
365
366
    ``a`` is the interpolation value, with 0 returing ``c1``,
367
    1 returning ``c2``, and 0.5 returing a color halfway between both.
368
369
    Args:
370
        c1 (Union[Tuple[int, int, int], Sequence[int]]):
371
            The first color.  At a=0.
372
        c2 (Union[Tuple[int, int, int], Sequence[int]]):
373
            The second color.  At a=1.
374
        a (float): The interpolation value,
375
376
    Returns:
377
        Color: The interpolated Color.
378
    """
379
    return Color._new_from_cdata(lib.TCOD_color_lerp(c1, c2, a))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_color_lerp.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
380
381
def color_set_hsv(c, h, s, v):
382
    """Set a color using: hue, saturation, and value parameters.
383
384
    Does not return a new Color.  Instead the provided color is modified.
385
386
    Args:
387
        c (Color): Must be a color instance.
388
        h (float): Hue, from 0 to 1.
389
        s (float): Saturation, from 0 to 1.
390
        v (float): Value, from 0 to 1.
391
    """
392
    new_color = ffi.new('TCOD_color_t*')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
393
    lib.TCOD_color_set_HSV(new_color, h, s, v)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_color_set_HSV.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
394
    c.r = new_color.r
395
    c.g = new_color.g
396
    c.b = new_color.b
397
398
def color_get_hsv(c):
399
    """Return the (hue, saturation, value) of a color.
400
401
    Args:
402
        c (Union[Tuple[int, int, int], Sequence[int]]):
403
            An (r, g, b) sequence or Color instance.
404
405
    Returns:
406
        Tuple[float, float, float]:
407
            A tuple with (hue, saturation, value) values, from 0 to 1.
408
    """
409
    h = ffi.new('float *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
410
    s = ffi.new('float *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
411
    v = ffi.new('float *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
412
    lib.TCOD_color_get_HSV(c, h, s, v)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_color_get_HSV.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
413
    return h[0], s[0], v[0]
414
415
def color_scale_HSV(c, scoef, vcoef):
416
    """Scale a color's saturation and value.
417
418
    Does not return a new Color.  Instead the provided color is modified.
419
420
    Args:
421
        c (Color): Must be a Color instance.
422
        scoef (float): Saturation multiplier, from 0 to 1.
423
                       Use 1 to keep current saturation.
424
        vcoef (float): Value multiplier, from 0 to 1.
425
                       Use 1 to keep current value.
426
    """
427
    color_p = ffi.new('TCOD_color_t*')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
428
    color_p.r, color_p.g, color_p.b = c.r, c.g, c.b
429
    lib.TCOD_color_scale_HSV(color_p, scoef, vcoef)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_color_scale_HSV.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
430
    c.r, c.g, c.b = color_p.r, color_p.g, color_p.b
431
432
def color_gen_map(colors, indexes):
433
    """Return a smoothly defined scale of colors.
434
435
    If ``indexes`` is [0, 3, 9] for example, the first color from ``colors``
436
    will be returned at 0, the 2nd will be at 3, and the 3rd will be at 9.
437
    All in-betweens will be filled with a gradient.
438
439
    Args:
440
        colors (Iterable[Union[Tuple[int, int, int], Sequence[int]]]):
441
            Array of colors to be sampled.
442
        indexes (Iterable[int]): A list of indexes.
443
444
    Returns:
445
        List[Color]: A list of Color instances.
446
447
    Example:
448
        >>> tcod.color_gen_map([(0, 0, 0), (255, 128, 0)], [0, 5])
449
        [Color(0,0,0), Color(51,25,0), Color(102,51,0), Color(153,76,0), \
450
Color(204,102,0), Color(255,128,0)]
451
    """
452
    ccolors = ffi.new('TCOD_color_t[]', colors)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
453
    cindexes = ffi.new('int[]', indexes)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
454
    cres = ffi.new('TCOD_color_t[]', max(indexes) + 1)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
455
    lib.TCOD_color_gen_map(cres, len(colors), ccolors, cindexes)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_color_gen_map.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
456
    return [Color._new_from_cdata(cdata) for cdata in cres]
457
458
_numpy = None
459
460
def _numpy_available():
461
    'check if numpy is available and lazily load it when needed'
462
    global _numpy
463
    if _numpy is None:
464
        try:
465
            import numpy as _numpy
0 ignored issues
show
Comprehensibility Bug introduced by
_numpy is re-defining a name which is already available in the outer-scope (previously defined on line 458).

It is generally a bad practice to shadow variables from the outer-scope. In most cases, this is done unintentionally and might lead to unexpected behavior:

param = 5

class Foo:
    def __init__(self, param):   # "param" would be flagged here
        self.param = param
Loading history...
466
        except ImportError:
467
            _numpy = False
468
    return _numpy
469
470
# initializing the console
471
def console_init_root(w, h, title, fullscreen=False,
472
                      renderer=RENDERER_SDL):
473
    """Set up the primary display and return the root console.
474
475
    Note:
476
        Currently only the SDL renderer is supported at the moment.
477
        Do not attempt to change it.
478
479
    Args:
480
        w (int): Width in character tiles for the root console.
481
        h (int): Height in character tiles for the root console.
482
        title (AnyStr):
483
            This string will be displayed on the created windows title bar.
484
        renderer: Rendering mode for libtcod to use.
485
486
    Returns:
487
        Console:
488
            Returns a special Console instance representing the root console.
489
    """
490
    lib.TCOD_console_init_root(w, h, _bytes(title), fullscreen, renderer)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_init_root.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
491
    return Console(ffi.NULL) # root console is null
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
492
493
494
def console_set_custom_font(fontFile, flags=FONT_LAYOUT_ASCII_INCOL,
495
                            nb_char_horiz=0, nb_char_vertic=0):
496
    """Load a custom font file.
497
498
    Call this before function before calling :any:`tcod.console_init_root`.
499
500
    Flags can be a mix of the following:
501
502
    * tcod.FONT_LAYOUT_ASCII_INCOL
503
    * tcod.FONT_LAYOUT_ASCII_INROW
504
    * tcod.FONT_TYPE_GREYSCALE
505
    * tcod.FONT_TYPE_GRAYSCALE
506
    * tcod.FONT_LAYOUT_TCOD
507
508
    Args:
509
        fontFile (AnyStr): Path to a font file.
510
        flags (int):
511
        nb_char_horiz (int):
512
        nb_char_vertic (int):
513
    """
514
    lib.TCOD_console_set_custom_font(_bytes(fontFile), flags,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_custom_font.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
515
                                     nb_char_horiz, nb_char_vertic)
516
517
518
def console_get_width(con):
519
    """Return the width of a console.
520
521
    Args:
522
        con (Console): Any Console instance.
523
524
    Returns:
525
        int: The width of a Console.
526
527
    .. deprecated:: 2.0
528
        Use `Console.get_width` instead.
529
    """
530
    return lib.TCOD_console_get_width(_cdata(con))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_get_width.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
531
532
def console_get_height(con):
533
    """Return the height of a console.
534
535
    Args:
536
        con (Console): Any Console instance.
537
538
    Returns:
539
        int: The height of a Console.
540
541
    .. deprecated:: 2.0
542
        Use `Console.get_hright` instead.
543
    """
544
    return lib.TCOD_console_get_height(_cdata(con))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_get_height.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
545
546
def console_map_ascii_code_to_font(asciiCode, fontCharX, fontCharY):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
547
    lib.TCOD_console_map_ascii_code_to_font(_int(asciiCode), fontCharX,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_map_ascii_code_to_font.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
548
                                                              fontCharY)
549
550
def console_map_ascii_codes_to_font(firstAsciiCode, nbCodes, fontCharX,
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
551
                                    fontCharY):
552
    lib.TCOD_console_map_ascii_codes_to_font(_int(firstAsciiCode), nbCodes,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_map_ascii_codes_to_font.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
553
                                              fontCharX, fontCharY)
554
555
def console_map_string_to_font(s, fontCharX, fontCharY):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
556
    lib.TCOD_console_map_string_to_font_utf(_unicode(s), fontCharX, fontCharY)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_map_string_to_font_utf.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
557
558
def console_is_fullscreen():
559
    """Returns True if the display is fullscreen.
560
561
    Returns:
562
        bool: True if the display is fullscreen, otherwise False.
563
    """
564
    return bool(lib.TCOD_console_is_fullscreen())
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_is_fullscreen.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
565
566
def console_set_fullscreen(fullscreen):
567
    """Change the display to be fullscreen or windowed.
568
569
    Args:
570
        fullscreen (bool): Use True to change to fullscreen.
571
                           Use False to change to windowed.
572
    """
573
    lib.TCOD_console_set_fullscreen(fullscreen)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_fullscreen.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
574
575
def console_is_window_closed():
576
    """Returns True if the window has received and exit event."""
577
    return lib.TCOD_console_is_window_closed()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_is_window_closed.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
578
579
def console_set_window_title(title):
580
    """Change the current title bar string.
581
582
    Args:
583
        title (AnyStr): A string to change the title bar to.
584
    """
585
    lib.TCOD_console_set_window_title(_bytes(title))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_window_title.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
586
587
def console_credits():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
588
    lib.TCOD_console_credits()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_credits.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
589
590
def console_credits_reset():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
591
    lib.TCOD_console_credits_reset()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_credits_reset.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
592
593
def console_credits_render(x, y, alpha):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
594
    return lib.TCOD_console_credits_render(x, y, alpha)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_credits_render.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
595
596
def console_flush():
597
    """Update the display to represent the root consoles current state."""
598
    lib.TCOD_console_flush()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_flush.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
599
600
# drawing on a console
601
def console_set_default_background(con, col):
602
    """Change the default background color for a console.
603
604
    Args:
605
        con (Console): Any Console instance.
606
        col (Union[Tuple[int, int, int], Sequence[int]]):
607
            An (r, g, b) sequence or Color instance.
608
    """
609
    lib.TCOD_console_set_default_background(_cdata(con), col)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_default_background.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
610
611
def console_set_default_foreground(con, col):
612
    """Change the default foreground color for a console.
613
614
    Args:
615
        con (Console): Any Console instance.
616
        col (Union[Tuple[int, int, int], Sequence[int]]):
617
            An (r, g, b) sequence or Color instance.
618
    """
619
    lib.TCOD_console_set_default_foreground(_cdata(con), col)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_default_foreground.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
620
621
def console_clear(con):
622
    """Reset a console to its default colors and the space character.
623
624
    Args:
625
        con (Console): Any Console instance.
626
627
    .. seealso::
628
       :any:`console_set_default_background`
629
       :any:`console_set_default_foreground`
630
    """
631
    return lib.TCOD_console_clear(_cdata(con))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_clear.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
632
633
def console_put_char(con, x, y, c, flag=BKGND_DEFAULT):
634
    """Draw the character c at x,y using the default colors and a blend mode.
635
636
    Args:
637
        con (Console): Any Console instance.
638
        x (int): Character x position from the left.
639
        y (int): Character y position from the top.
640
        c (Union[int, AnyStr]): Character to draw, can be an integer or string.
641
        flag (int): Blending mode to use, defaults to BKGND_DEFAULT.
642
    """
643
    lib.TCOD_console_put_char(_cdata(con), x, y, _int(c), flag)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_put_char.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
644
645
def console_put_char_ex(con, x, y, c, fore, back):
646
    """Draw the character c at x,y using the colors fore and back.
647
648
    Args:
649
        con (Console): Any Console instance.
650
        x (int): Character x position from the left.
651
        y (int): Character y position from the top.
652
        c (Union[int, AnyStr]): Character to draw, can be an integer or string.
653
        fore (Union[Tuple[int, int, int], Sequence[int]]):
654
            An (r, g, b) sequence or Color instance.
655
        back (Union[Tuple[int, int, int], Sequence[int]]):
656
            An (r, g, b) sequence or Color instance.
657
    """
658
    lib.TCOD_console_put_char_ex(_cdata(con), x, y,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_put_char_ex.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
659
                                 _int(c), fore, back)
660
661
def console_set_char_background(con, x, y, col, flag=BKGND_SET):
662
    """Change the background color of x,y to col using a blend mode.
663
664
    Args:
665
        con (Console): Any Console instance.
666
        x (int): Character x position from the left.
667
        y (int): Character y position from the top.
668
        col (Union[Tuple[int, int, int], Sequence[int]]):
669
            An (r, g, b) sequence or Color instance.
670
        flag (int): Blending mode to use, defaults to BKGND_SET.
671
    """
672
    lib.TCOD_console_set_char_background(_cdata(con), x, y, col, flag)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_char_background.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
673
674
def console_set_char_foreground(con, x, y, col):
675
    """Change the foreground color of x,y to col.
676
677
    Args:
678
        con (Console): Any Console instance.
679
        x (int): Character x position from the left.
680
        y (int): Character y position from the top.
681
        col (Union[Tuple[int, int, int], Sequence[int]]):
682
            An (r, g, b) sequence or Color instance.
683
    """
684
    lib.TCOD_console_set_char_foreground(_cdata(con), x, y, col)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_char_foreground.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
685
686
def console_set_char(con, x, y, c):
687
    """Change the character at x,y to c, keeping the current colors.
688
689
    Args:
690
        con (Console): Any Console instance.
691
        x (int): Character x position from the left.
692
        y (int): Character y position from the top.
693
        c (Union[int, AnyStr]): Character to draw, can be an integer or string.
694
    """
695
    lib.TCOD_console_set_char(_cdata(con), x, y, _int(c))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_char.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
696
697
def console_set_background_flag(con, flag):
698
    """Change the default blend mode for this console.
699
700
    Args:
701
        con (Console): Any Console instance.
702
        flag (int): Blend mode to use by default.
703
    """
704
    lib.TCOD_console_set_background_flag(_cdata(con), flag)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_background_flag.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
705
706
def console_get_background_flag(con):
707
    """Return this consoles current blend mode.
708
709
    Args:
710
        con (Console): Any Console instance.
711
    """
712
    return lib.TCOD_console_get_background_flag(_cdata(con))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_get_background_flag.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
713
714
def console_set_alignment(con, alignment):
715
    """Change this consoles current alignment mode.
716
717
    * tcod.LEFT
718
    * tcod.CENTER
719
    * tcod.RIGHT
720
721
    Args:
722
        con (Console): Any Console instance.
723
        alignment (int):
724
    """
725
    lib.TCOD_console_set_alignment(_cdata(con), alignment)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_alignment.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
726
727
def console_get_alignment(con):
728
    """Return this consoles current alignment mode.
729
730
    Args:
731
        con (Console): Any Console instance.
732
    """
733
    return lib.TCOD_console_get_alignment(_cdata(con))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_get_alignment.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
734
735
def console_print(con, x, y, fmt):
736
    """Print a color formatted string on a console.
737
738
    Args:
739
        con (Console): Any Console instance.
740
        x (int): Character x position from the left.
741
        y (int): Character y position from the top.
742
        fmt (AnyStr): A unicode or bytes string optionaly using color codes.
743
    """
744
    lib.TCOD_console_print_utf(_cdata(con), x, y, _fmt_unicode(fmt))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_print_utf.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
745
746
def console_print_ex(con, x, y, flag, alignment, fmt):
747
    """Print a string on a console using a blend mode and alignment mode.
748
749
    Args:
750
        con (Console): Any Console instance.
751
        x (int): Character x position from the left.
752
        y (int): Character y position from the top.
753
    """
754
    lib.TCOD_console_print_ex_utf(_cdata(con), x, y,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_print_ex_utf.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
755
                                   flag, alignment, _fmt_unicode(fmt))
756
757
def console_print_rect(con, x, y, w, h, fmt):
758
    """Print a string constrained to a rectangle.
759
760
    If h > 0 and the bottom of the rectangle is reached,
761
    the string is truncated. If h = 0,
762
    the string is only truncated if it reaches the bottom of the console.
763
764
765
766
    Returns:
767
        int: The number of lines of text once word-wrapped.
768
    """
769
    return lib.TCOD_console_print_rect_utf(_cdata(con), x, y, w, h,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_print_rect_utf.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
770
                                            _fmt_unicode(fmt))
771
772
def console_print_rect_ex(con, x, y, w, h, flag, alignment, fmt):
773
    """Print a string constrained to a rectangle with blend and alignment.
774
775
    Returns:
776
        int: The number of lines of text once word-wrapped.
777
    """
778
    return lib.TCOD_console_print_rect_ex_utf(_cdata(con), x, y, w, h,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_print_rect_ex_utf.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
779
                                              flag, alignment,
780
                                              _fmt_unicode(fmt))
781
782
def console_get_height_rect(con, x, y, w, h, fmt):
783
    """Return the height of this text once word-wrapped into this rectangle.
784
785
    Returns:
786
        int: The number of lines of text once word-wrapped.
787
    """
788
    return lib.TCOD_console_get_height_rect_utf(_cdata(con), x, y, w, h,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_get_height_rect_utf.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
789
                                                 _fmt_unicode(fmt))
790
791
def console_rect(con, x, y, w, h, clr, flag=BKGND_DEFAULT):
792
    """Draw a the background color on a rect optionally clearing the text.
793
794
    If clr is True the affected tiles are changed to space character.
795
    """
796
    lib.TCOD_console_rect(_cdata(con), x, y, w, h, clr, flag)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_rect.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
797
798
def console_hline(con, x, y, l, flag=BKGND_DEFAULT):
799
    """Draw a horizontal line on the console.
800
801
    This always uses the character 196, the horizontal line character.
802
    """
803
    lib.TCOD_console_hline(_cdata(con), x, y, l, flag)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_hline.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
804
805
def console_vline(con, x, y, l, flag=BKGND_DEFAULT):
806
    """Draw a vertical line on the console.
807
808
    This always uses the character 179, the vertical line character.
809
    """
810
    lib.TCOD_console_vline(_cdata(con), x, y, l, flag)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_vline.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
811
812
def console_print_frame(con, x, y, w, h, clear=True, flag=BKGND_DEFAULT, fmt=b''):
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (82/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
813
    """Draw a framed rectangle with optinal text.
814
815
    This uses the default background color and blend mode to fill the
816
    rectangle and the default foreground to draw the outline.
817
818
    fmt will be printed on the inside of the rectangle, word-wrapped.
819
    """
820
    lib.TCOD_console_print_frame(_cdata(con), x, y, w, h, clear, flag,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_print_frame.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
821
                                  _fmt_bytes(fmt))
822
823
def console_set_color_control(con, fore, back):
824
    """Configure :any:`color controls`.
825
826
    Args:
827
        con (int): :any:`Color control` constant to modify.
828
        fore (Union[Tuple[int, int, int], Sequence[int]]):
829
            An (r, g, b) sequence or Color instance.
830
        back (Union[Tuple[int, int, int], Sequence[int]]):
831
            An (r, g, b) sequence or Color instance.
832
    """
833
    lib.TCOD_console_set_color_control(_cdata(con), fore, back)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_color_control.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
834
835
def console_get_default_background(con):
836
    """Return this consoles default background color."""
837
    return Color._new_from_cdata(
838
        lib.TCOD_console_get_default_background(_cdata(con)))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_get_default_background.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
839
840
def console_get_default_foreground(con):
841
    """Return this consoles default foreground color."""
842
    return Color._new_from_cdata(
843
        lib.TCOD_console_get_default_foreground(_cdata(con)))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_get_default_foreground.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
844
845
def console_get_char_background(con, x, y):
846
    """Return the background color at the x,y of this console."""
847
    return Color._new_from_cdata(
848
        lib.TCOD_console_get_char_background(_cdata(con), x, y))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_get_char_background.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
849
850
def console_get_char_foreground(con, x, y):
851
    """Return the foreground color at the x,y of this console."""
852
    return Color._new_from_cdata(
853
        lib.TCOD_console_get_char_foreground(_cdata(con), x, y))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_get_char_foreground.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
854
855
def console_get_char(con, x, y):
856
    """Return the character at the x,y of this console."""
857
    return lib.TCOD_console_get_char(_cdata(con), x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_get_char.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
858
859
def console_set_fade(fade, fadingColor):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
860
    lib.TCOD_console_set_fade(fade, fadingColor)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_fade.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
861
862
def console_get_fade():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
863
    return lib.TCOD_console_get_fade()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_get_fade.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
864
865
def console_get_fading_color():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
866
    return Color._new_from_cdata(lib.TCOD_console_get_fading_color())
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_get_fading_color.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
867
868
# handling keyboard input
869
def console_wait_for_keypress(flush):
870
    """Block until the user presses a key, then returns a new Key.
871
872
    Args:
873
        flush bool: If True then the event queue is cleared before waiting
874
                    for the next event.
875
876
    Returns:
877
        Key: A new Key instance.
878
    """
879
    k=Key()
0 ignored issues
show
Coding Style introduced by
Exactly one space required around assignment
k=Key()
^
Loading history...
880
    lib.TCOD_console_wait_for_keypress_wrapper(k.cdata, flush)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_wait_for_keypress_wrapper.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
881
    return k
882
883
def console_check_for_keypress(flags=KEY_RELEASED):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
884
    k=Key()
0 ignored issues
show
Coding Style introduced by
Exactly one space required around assignment
k=Key()
^
Loading history...
885
    lib.TCOD_console_check_for_keypress_wrapper(k.cdata, flags)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_check_for_keypress_wrapper.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
886
    return k
887
888
def console_is_key_pressed(key):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
889
    return lib.TCOD_console_is_key_pressed(key)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_is_key_pressed.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
890
891
def console_set_keyboard_repeat(initial_delay, interval):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
892
    lib.TCOD_console_set_keyboard_repeat(initial_delay, interval)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_keyboard_repeat.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
893
894
def console_disable_keyboard_repeat():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
895
    lib.TCOD_console_disable_keyboard_repeat()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_disable_keyboard_repeat.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
896
897
# using offscreen consoles
898
def console_new(w, h):
899
    """Return an offscreen console of size: w,h."""
900
    return Console(ffi.gc(lib.TCOD_console_new(w, h), lib.TCOD_console_delete))
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
901
def console_from_file(filename):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
902
    return Console(lib.TCOD_console_from_file(_bytes(filename)))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_from_file.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
903
904
def console_blit(src, x, y, w, h, dst, xdst, ydst, ffade=1.0,bfade=1.0):
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
def console_blit(src, x, y, w, h, dst, xdst, ydst, ffade=1.0,bfade=1.0):
^
Loading history...
905
    """Blit the console src from x,y,w,h to console dst at xdst,ydst."""
906
    lib.TCOD_console_blit(_cdata(src), x, y, w, h,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_blit.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
907
                          _cdata(dst), xdst, ydst, ffade, bfade)
908
909
def console_set_key_color(con, col):
910
    """Set a consoles blit transparent color."""
911
    lib.TCOD_console_set_key_color(_cdata(con), col)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_set_key_color.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
912
913
def console_delete(con):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
914
    con = _cdata(con)
915 View Code Duplication
    if con == ffi.NULL:
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
916
        lib.TCOD_console_delete(con)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
917
918
# fast color filling
919
def console_fill_foreground(con, r, g, b):
920
    """Fill the foregound of a console with r,g,b.
921
922
    Args:
923
        con (Console): Any Console instance.
924
        r (Sequence[int]): An array of integers with a length of width*height.
925
        g (Sequence[int]): An array of integers with a length of width*height.
926
        b (Sequence[int]): An array of integers with a length of width*height.
927
    """
928
    if len(r) != len(g) or len(r) != len(b):
929
        raise TypeError('R, G and B must all have the same size.')
930
    if (_numpy_available() and isinstance(r, _numpy.ndarray) and
0 ignored issues
show
Bug introduced by
The Instance of bool does not seem to have a member named ndarray.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
931
        isinstance(g, _numpy.ndarray) and isinstance(b, _numpy.ndarray)):
0 ignored issues
show
Bug introduced by
The Instance of bool does not seem to have a member named ndarray.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
932
        #numpy arrays, use numpy's ctypes functions
933
        r = _numpy.ascontiguousarray(r, dtype=_numpy.intc)
0 ignored issues
show
Bug introduced by
The Instance of bool does not seem to have a member named ascontiguousarray.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of bool does not seem to have a member named intc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
934
        g = _numpy.ascontiguousarray(g, dtype=_numpy.intc)
0 ignored issues
show
Bug introduced by
The Instance of bool does not seem to have a member named ascontiguousarray.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of bool does not seem to have a member named intc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
935
        b = _numpy.ascontiguousarray(b, dtype=_numpy.intc)
0 ignored issues
show
Bug introduced by
The Instance of bool does not seem to have a member named ascontiguousarray.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of bool does not seem to have a member named intc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
936
        cr = ffi.cast('int *', r.ctypes.data)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named cast.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
937
        cg = ffi.cast('int *', g.ctypes.data)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named cast.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
938
        cb = ffi.cast('int *', b.ctypes.data)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named cast.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
939
    else:
940
        # otherwise convert using ffi arrays
941
        cr = ffi.new('int[]', r)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
942
        cg = ffi.new('int[]', g)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
943 View Code Duplication
        cb = ffi.new('int[]', b)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
944
945
    lib.TCOD_console_fill_foreground(_cdata(con), cr, cg, cb)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_fill_foreground.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
946
947
def console_fill_background(con, r, g, b):
948
    """Fill the backgound of a console with r,g,b.
949
950
    Args:
951
        con (Console): Any Console instance.
952
        r (Sequence[int]): An array of integers with a length of width*height.
953
        g (Sequence[int]): An array of integers with a length of width*height.
954
        b (Sequence[int]): An array of integers with a length of width*height.
955
    """
956
    if len(r) != len(g) or len(r) != len(b):
957
        raise TypeError('R, G and B must all have the same size.')
958
    if (_numpy_available() and isinstance(r, _numpy.ndarray) and
0 ignored issues
show
Bug introduced by
The Instance of bool does not seem to have a member named ndarray.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
959
        isinstance(g, _numpy.ndarray) and isinstance(b, _numpy.ndarray)):
0 ignored issues
show
Bug introduced by
The Instance of bool does not seem to have a member named ndarray.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
960
        #numpy arrays, use numpy's ctypes functions
961
        r = _numpy.ascontiguousarray(r, dtype=_numpy.intc)
0 ignored issues
show
Bug introduced by
The Instance of bool does not seem to have a member named ascontiguousarray.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of bool does not seem to have a member named intc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
962
        g = _numpy.ascontiguousarray(g, dtype=_numpy.intc)
0 ignored issues
show
Bug introduced by
The Instance of bool does not seem to have a member named ascontiguousarray.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of bool does not seem to have a member named intc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
963
        b = _numpy.ascontiguousarray(b, dtype=_numpy.intc)
0 ignored issues
show
Bug introduced by
The Instance of bool does not seem to have a member named ascontiguousarray.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of bool does not seem to have a member named intc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
964
        cr = ffi.cast('int *', r.ctypes.data)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named cast.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
965
        cg = ffi.cast('int *', g.ctypes.data)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named cast.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
966
        cb = ffi.cast('int *', b.ctypes.data)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named cast.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
967
    else:
968
        # otherwise convert using ffi arrays
969
        cr = ffi.new('int[]', r)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
970
        cg = ffi.new('int[]', g)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
971
        cb = ffi.new('int[]', b)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
972
973
    lib.TCOD_console_fill_background(_cdata(con), cr, cg, cb)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_fill_background.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
974
975
def console_fill_char(con,arr):
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
def console_fill_char(con,arr):
^
Loading history...
976
    """Fill the character tiles of a console with an array.
977
978
    Args:
979
        con (Console): Any Console instance.
980
        arr (Sequence[int]): An array of integers with a length of width*height.
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (80/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
981
    """
982
    if (_numpy_available() and isinstance(arr, _numpy.ndarray) ):
0 ignored issues
show
Unused Code Coding Style introduced by
There is an unnecessary parenthesis after if.
Loading history...
Coding Style introduced by
No space allowed before bracket
if (_numpy_available() and isinstance(arr, _numpy.ndarray) ):
^
Loading history...
Bug introduced by
The Instance of bool does not seem to have a member named ndarray.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
983
        #numpy arrays, use numpy's ctypes functions
984
        arr = _numpy.ascontiguousarray(arr, dtype=_numpy.intc)
0 ignored issues
show
Bug introduced by
The Instance of bool does not seem to have a member named ascontiguousarray.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of bool does not seem to have a member named intc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
985
        carr = ffi.cast('int *', arr.ctypes.data)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named cast.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
986
    else:
987
        #otherwise convert using the ffi module
988
        carr = ffi.new('int[]', arr)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
989
990
    lib.TCOD_console_fill_char(_cdata(con), carr)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_fill_char.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
991
992
def console_load_asc(con, filename):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
993
    return lib.TCOD_console_load_asc(_cdata(con), _bytes(filename))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_load_asc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
994
995
def console_save_asc(con, filename):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
996
    lib.TCOD_console_save_asc(_cdata(con),_bytes(filename))
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
lib.TCOD_console_save_asc(_cdata(con),_bytes(filename))
^
Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_save_asc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
997
998
def console_load_apf(con, filename):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
999
    return lib.TCOD_console_load_apf(_cdata(con),_bytes(filename))
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
return lib.TCOD_console_load_apf(_cdata(con),_bytes(filename))
^
Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_load_apf.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1000
1001
def console_save_apf(con, filename):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1002
    lib.TCOD_console_save_apf(_cdata(con),_bytes(filename))
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
lib.TCOD_console_save_apf(_cdata(con),_bytes(filename))
^
Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_console_save_apf.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1003
1004
@ffi.def_extern()
1005
def _pycall_path_func(x1, y1, x2, y2, handle):
1006
    '''static float _pycall_path_func( int xFrom, int yFrom, int xTo, int yTo, void *user_data );
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (97/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
1007
    '''
1008
    func, propagate_manager, user_data = ffi.from_handle(handle)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named from_handle.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1009
    try:
1010
        return func(x1, y1, x2, y2, *user_data)
1011
    except BaseException:
1012
        propagate_manager.propagate(*_sys.exc_info())
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable '_sys'
Loading history...
1013
        return None
1014
1015
def path_new_using_map(m, dcost=1.41):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1016
    return (ffi.gc(lib.TCOD_path_new_using_map(m, dcost),
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_path_new_using_map.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1017
                    lib.TCOD_path_delete), _PropagateException())
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_path_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1018
1019
def path_new_using_function(w, h, func, userData=0, dcost=1.41):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1020
    propagator = _PropagateException()
1021
    handle = ffi.new_handle((func, propagator, (userData,)))
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new_handle.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1022
    return (ffi.gc(lib.TCOD_path_new_using_function(w, h, lib._pycall_path_func,
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (80/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_path_new_using_function.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named _pycall_path_func.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1023
            handle, dcost), lib.TCOD_path_delete), propagator, handle)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_path_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1024
1025
def path_compute(p, ox, oy, dx, dy):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1026
    with p[1]:
1027
        return lib.TCOD_path_compute(p[0], ox, oy, dx, dy)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_path_compute.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1028
1029
def path_get_origin(p):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1030
    x = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1031
    y = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1032
    lib.TCOD_path_get_origin(p[0], x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_path_get_origin.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1033
    return x[0], y[0]
1034
1035
def path_get_destination(p):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1036
    x = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1037
    y = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1038
    lib.TCOD_path_get_destination(p[0], x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_path_get_destination.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1039
    return x[0], y[0]
1040
1041
def path_size(p):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1042
    return lib.TCOD_path_size(p[0])
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_path_size.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1043
1044
def path_reverse(p):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1045
    lib.TCOD_path_reverse(p[0])
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_path_reverse.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1046
1047
def path_get(p, idx):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1048
    x = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1049
    y = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1050
    lib.TCOD_path_get(p[0], idx, x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_path_get.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1051
    return x[0], y[0]
1052
1053
def path_is_empty(p):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1054
    return lib.TCOD_path_is_empty(p[0])
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_path_is_empty.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1055
1056
def path_walk(p, recompute):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1057
    x = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1058
    y = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1059
    with p[1]:
1060
        if lib.TCOD_path_walk(p[0], x, y, recompute):
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_path_walk.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1061
            return x[0], y[0]
1062
    return None,None
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
return None,None
^
Loading history...
1063
1064
def path_delete(p):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The argument p seems to be unused.
Loading history...
1065
    pass
1066
1067
def dijkstra_new(m, dcost=1.41):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1068
    return (ffi.gc(lib.TCOD_dijkstra_new(m, dcost),
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_dijkstra_new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1069
                    lib.TCOD_dijkstra_delete), _PropagateException())
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_dijkstra_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1070
1071
def dijkstra_new_using_function(w, h, func, userData=0, dcost=1.41):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1072
    propagator = _PropagateException()
1073
    handle = ffi.new_handle((func, propagator, (userData,)))
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new_handle.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1074
    return (ffi.gc(lib.TCOD_dijkstra_new_using_function(w, h,
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_dijkstra_new_using_function.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1075
                    lib._pycall_path_func, handle, dcost),
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named _pycall_path_func.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1076
                    lib.TCOD_dijkstra_delete), propagator, handle)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_dijkstra_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1077
1078
def dijkstra_compute(p, ox, oy):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1079
    with p[1]:
1080
        lib.TCOD_dijkstra_compute(p[0], ox, oy)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_dijkstra_compute.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1081
1082
def dijkstra_path_set(p, x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1083
    return lib.TCOD_dijkstra_path_set(p[0], x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_dijkstra_path_set.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1084
1085
def dijkstra_get_distance(p, x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1086
    return lib.TCOD_dijkstra_get_distance(p[0], x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_dijkstra_get_distance.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1087
1088
def dijkstra_size(p):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1089
    return lib.TCOD_dijkstra_size(p[0])
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_dijkstra_size.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1090
1091
def dijkstra_reverse(p):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1092
    lib.TCOD_dijkstra_reverse(p[0])
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_dijkstra_reverse.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1093
1094
def dijkstra_get(p, idx):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1095
    x = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1096
    y = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1097
    lib.TCOD_dijkstra_get(p[0], idx, x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_dijkstra_get.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1098
    return x[0], y[0]
1099
1100
def dijkstra_is_empty(p):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1101
    return lib.TCOD_dijkstra_is_empty(p[0])
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_dijkstra_is_empty.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1102
1103
def dijkstra_path_walk(p):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1104
    x = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1105
    y = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1106
    if lib.TCOD_dijkstra_path_walk(p[0], x, y):
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_dijkstra_path_walk.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1107
        return x[0], y[0]
1108
    return None,None
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
return None,None
^
Loading history...
1109
1110
def dijkstra_delete(p):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The argument p seems to be unused.
Loading history...
1111
    pass
1112
1113
def heightmap_new(w, h):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1114
    return HeightMap(w, h)
1115
1116
def heightmap_set_value(hm, x, y, value):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1117
    lib.TCOD_heightmap_set_value(hm.cdata, x, y, value)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_set_value.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1118
1119
def heightmap_add(hm, value):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1120
    lib.TCOD_heightmap_add(hm.cdata, value)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_add.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1121
1122
def heightmap_scale(hm, value):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1123
    lib.TCOD_heightmap_scale(hm.cdata, value)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_scale.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1124
1125
def heightmap_clear(hm):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1126
    lib.TCOD_heightmap_clear(hm.cdata)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_clear.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1127
1128
def heightmap_clamp(hm, mi, ma):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1129
    lib.TCOD_heightmap_clamp(hm.cdata, mi, ma)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_clamp.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1130
1131
def heightmap_copy(hm1, hm2):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1132
    lib.TCOD_heightmap_copy(hm1.cdata, hm2.cdata)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_copy.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1133
1134
def heightmap_normalize(hm,  mi=0.0, ma=1.0):
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
def heightmap_normalize(hm, mi=0.0, ma=1.0):
^
Loading history...
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1135
    lib.TCOD_heightmap_normalize(hm.cdata, mi, ma)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_normalize.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1136
1137
def heightmap_lerp_hm(hm1, hm2, hm3, coef):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1138
    lib.TCOD_heightmap_lerp_hm(hm1.cdata, hm2.cdata, hm3.cdata, coef)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_lerp_hm.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1139
1140
def heightmap_add_hm(hm1, hm2, hm3):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1141
    lib.TCOD_heightmap_add_hm(hm1.cdata, hm2.cdata, hm3.cdata)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_add_hm.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1142
1143
def heightmap_multiply_hm(hm1, hm2, hm3):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1144
    lib.TCOD_heightmap_multiply_hm(hm1.cdata, hm2.cdata, hm3.cdata)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_multiply_hm.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1145
1146
def heightmap_add_hill(hm, x, y, radius, height):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1147
    lib.TCOD_heightmap_add_hill(hm.cdata, x, y, radius, height)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_add_hill.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1148
1149
def heightmap_dig_hill(hm, x, y, radius, height):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1150
    lib.TCOD_heightmap_dig_hill(hm.cdata, x, y, radius, height)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_dig_hill.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1151
1152
def heightmap_rain_erosion(hm, nbDrops, erosionCoef, sedimentationCoef, rnd=None):
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (82/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1153
    lib.TCOD_heightmap_rain_erosion(hm.cdata, nbDrops, erosionCoef,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_rain_erosion.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1154
                                     sedimentationCoef, rnd or ffi.NULL)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1155
1156
def heightmap_kernel_transform(hm, kernelsize, dx, dy, weight, minLevel,
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1157
                               maxLevel):
1158
    cdx = ffi.new('int[]', dx)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1159
    cdy = ffi.new('int[]', dy)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1160
    cweight = ffi.new('float[]', weight)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1161
    lib.TCOD_heightmap_kernel_transform(hm.cdata, kernelsize, cdx, cdy, cweight,
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (80/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_kernel_transform.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1162
                                         minLevel, maxLevel)
1163
1164
def heightmap_add_voronoi(hm, nbPoints, nbCoef, coef, rnd=None):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1165
    ccoef = ffi.new('float[]', coef)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1166
    lib.TCOD_heightmap_add_voronoi(hm.cdata, nbPoints, nbCoef, ccoef, rnd or ffi.NULL)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (86/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_add_voronoi.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1167
1168
def heightmap_add_fbm(hm, noise, mulx, muly, addx, addy, octaves, delta, scale):
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (80/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1169
    lib.TCOD_heightmap_add_fbm(hm.cdata, noise, mulx, muly, addx, addy,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_add_fbm.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1170
                                octaves, delta, scale)
1171
def heightmap_scale_fbm(hm, noise, mulx, muly, addx, addy, octaves, delta,
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1172
                        scale):
1173
    lib.TCOD_heightmap_scale_fbm(hm.cdata, noise, mulx, muly, addx, addy,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_scale_fbm.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1174
                                  octaves, delta, scale)
1175
1176
def heightmap_dig_bezier(hm, px, py, startRadius, startDepth, endRadius,
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1177
                         endDepth):
1178
    #IARRAY = c_int * 4
1179
    cpx = ffi.new('int[4]', px)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1180
    cpy = ffi.new('int[4]', py)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1181
    lib.TCOD_heightmap_dig_bezier(hm.cdata, cpx, cpy, startRadius,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_dig_bezier.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1182
                                   startDepth, endRadius,
1183
                                   endDepth)
1184
1185
def heightmap_get_value(hm, x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1186
    return lib.TCOD_heightmap_get_value(hm.cdata, x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_get_value.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1187
1188
def heightmap_get_interpolated_value(hm, x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1189
    return lib.TCOD_heightmap_get_interpolated_value(hm.cdata, x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_get_interpolated_value.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1190
1191
def heightmap_get_slope(hm, x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1192
    return lib.TCOD_heightmap_get_slope(hm.cdata, x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_get_slope.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1193
1194
def heightmap_get_normal(hm, x, y, waterLevel):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1195
    #FARRAY = c_float * 3
1196
    cn = ffi.new('float[3]')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1197
    lib.TCOD_heightmap_get_normal(hm.cdata, x, y, cn, waterLevel)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_get_normal.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1198
    return tuple(cn)
1199
1200
def heightmap_count_cells(hm, mi, ma):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1201
    return lib.TCOD_heightmap_count_cells(hm.cdata, mi, ma)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_count_cells.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1202
1203
def heightmap_has_land_on_border(hm, waterlevel):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1204
    return lib.TCOD_heightmap_has_land_on_border(hm.cdata, waterlevel)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_has_land_on_border.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1205
1206
def heightmap_get_minmax(hm):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1207
    mi = ffi.new('float *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1208
    ma = ffi.new('float *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1209
    lib.TCOD_heightmap_get_minmax(hm.cdata, mi, ma)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_heightmap_get_minmax.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1210
    return mi[0], ma[0]
1211
1212
def heightmap_delete(hm):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The argument hm seems to be unused.
Loading history...
1213
    pass
1214
1215
def image_new(width, height):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1216
    return Image(width, height)
1217
1218
def image_clear(image, col):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1219
    lib.TCOD_image_clear(_cdata(image), col)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_clear.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1220
1221
def image_invert(image):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1222
    lib.TCOD_image_invert(_cdata(image))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_invert.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1223
1224
def image_hflip(image):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1225
    lib.TCOD_image_hflip(_cdata(image))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_hflip.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1226
1227
def image_rotate90(image, num=1):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1228
    lib.TCOD_image_rotate90(_cdata(image), num)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_rotate90.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1229
1230
def image_vflip(image):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1231
    lib.TCOD_image_vflip(_cdata(image))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_vflip.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1232
1233
def image_scale(image, neww, newh):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1234
    lib.TCOD_image_scale(_cdata(image), neww, newh)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_scale.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1235
1236
def image_set_key_color(image, col):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1237
    lib.TCOD_image_set_key_color(_cdata(image), col)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_set_key_color.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1238
1239
def image_get_alpha(image, x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1240
    return lib.TCOD_image_get_alpha(_cdata(image), x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_get_alpha.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1241
1242
def image_is_pixel_transparent(image, x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1243
    return lib.TCOD_image_is_pixel_transparent(_cdata(image), x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_is_pixel_transparent.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1244
1245
def image_load(filename):
1246
    """Load an image file into an Image instance and return it.
1247
1248
    Args:
1249
        filename (AnyStr): Path to a .bmp or .png image file.
1250
    """
1251
    return Image(ffi.gc(lib.TCOD_image_load(_bytes(filename)),
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_load.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1252
                        lib.TCOD_image_delete))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1253
1254
def image_from_console(console):
1255
    """Return an Image with a Consoles pixel data.
1256
1257
    This effectively takes a screen-shot of the Console.
1258
1259
    Args:
1260
        console (Console): Any Console instance.
1261
    """
1262
    return Image(ffi.gc(lib.TCOD_image_from_console(_cdata(console)),
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_from_console.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1263
                        lib.TCOD_image_delete))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1264
1265
def image_refresh_console(image, console):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1266
    lib.TCOD_image_refresh_console(_cdata(image), _cdata(console))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_refresh_console.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1267
1268
def image_get_size(image):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1269
    w = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1270
    h = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1271
    lib.TCOD_image_get_size(_cdata(image), w, h)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_get_size.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1272
    return w[0], h[0]
1273
1274
def image_get_pixel(image, x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1275
    return lib.TCOD_image_get_pixel(_cdata(image), x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_get_pixel.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1276
1277
def image_get_mipmap_pixel(image, x0, y0, x1, y1):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1278
    return lib.TCOD_image_get_mipmap_pixel(_cdata(image), x0, y0, x1, y1)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_get_mipmap_pixel.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1279
1280
def image_put_pixel(image, x, y, col):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1281
    lib.TCOD_image_put_pixel(_cdata(image), x, y, col)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_put_pixel.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1282
1283
def image_blit(image, console, x, y, bkgnd_flag, scalex, scaley, angle):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1284
    lib.TCOD_image_blit(_cdata(image), _cdata(console), x, y, bkgnd_flag,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_blit.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1285
                         scalex, scaley, angle)
1286
1287
def image_blit_rect(image, console, x, y, w, h, bkgnd_flag):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1288
    lib.TCOD_image_blit_rect(_cdata(image), _cdata(console),
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_blit_rect.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1289
                             x, y, w, h, bkgnd_flag)
1290
1291
def image_blit_2x(image, console, dx, dy, sx=0, sy=0, w=-1, h=-1):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1292
    lib.TCOD_image_blit_2x(_cdata(image), _cdata(console), dx,dy,sx,sy,w,h)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_blit_2x.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Coding Style introduced by
Exactly one space required after comma
lib.TCOD_image_blit_2x(_cdata(image), _cdata(console), dx,dy,sx,sy,w,h)
^
Loading history...
Coding Style introduced by
Exactly one space required after comma
lib.TCOD_image_blit_2x(_cdata(image), _cdata(console), dx,dy,sx,sy,w,h)
^
Loading history...
Coding Style introduced by
Exactly one space required after comma
lib.TCOD_image_blit_2x(_cdata(image), _cdata(console), dx,dy,sx,sy,w,h)
^
Loading history...
Coding Style introduced by
Exactly one space required after comma
lib.TCOD_image_blit_2x(_cdata(image), _cdata(console), dx,dy,sx,sy,w,h)
^
Loading history...
Coding Style introduced by
Exactly one space required after comma
lib.TCOD_image_blit_2x(_cdata(image), _cdata(console), dx,dy,sx,sy,w,h)
^
Loading history...
1293
1294
def image_save(image, filename):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1295
    lib.TCOD_image_save(_cdata(image), _bytes(filename))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_image_save.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1296
1297
def image_delete(image):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The argument image seems to be unused.
Loading history...
1298
    pass
1299
1300
def line_init(xo, yo, xd, yd):
1301
    """Initilize a line whose points will be returned by `line_step`.
1302
1303
    This function does not return anything on its own.
1304
1305
    Does not include the origin point.
1306
1307
    Args:
1308
        xo (int): X starting point.
1309
        yo (int): Y starting point.
1310
        xd (int): X destination point.
1311
        yd (int): Y destination point.
1312
1313
    .. deprecated:: 2.0
1314
       Use `line_iter` instead.
1315
    """
1316
    lib.TCOD_line_init(xo, yo, xd, yd)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_line_init.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1317
1318
def line_step():
1319
    """After calling line_init returns (x, y) points of the line.
1320
1321
    Once all points are exhausted this function will return (None, None)
1322
1323
    Returns:
1324
        Union[Tuple[int, int], Tuple[None, None]]:
1325
            The next (x, y) point of the line setup by line_init,
1326
            or (None, None) if there are no more points.
1327
1328
    .. deprecated:: 2.0
1329
       Use `line_iter` instead.
1330
    """
1331
    x = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1332
    y = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1333
    ret = lib.TCOD_line_step(x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_line_step.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1334
    if not ret:
1335
        return x[0], y[0]
1336
    return None,None
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
return None,None
^
Loading history...
1337
1338
_line_listener_lock = _threading.Lock()
1339
1340
def line(xo, yo, xd, yd, py_callback):
1341
    """ Iterate over a line using a callback function.
1342
1343
    Your callback function will take x and y parameters and return True to
1344
    continue iteration or False to stop iteration and return.
1345
1346
    This function includes both the start and end points.
1347
1348
    Args:
1349
        xo (int): X starting point.
1350
        yo (int): Y starting point.
1351
        xd (int): X destination point.
1352
        yd (int): Y destination point.
1353
        py_callback (Callable[[int, int], bool]):
1354
            A callback which takes x and y parameters and returns bool.
1355
1356
    Returns:
1357
        bool: False if the callback cancels the line interation by
1358
              returning False or None, otherwise True.
1359
1360
    .. deprecated:: 2.0
1361
       Use `line_iter` instead.
1362
    """
1363
    with _PropagateException() as propagate:
1364
        with _line_listener_lock:
1365
            @ffi.def_extern(onerror=propagate)
1366
            def _pycall_line_listener(x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The variable _pycall_line_listener seems to be unused.
Loading history...
1367
                return py_callback(x, y)
1368
            return bool(lib.TCOD_line(xo, yo, xd, yd,
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_line.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1369
                                       lib._pycall_line_listener))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named _pycall_line_listener.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1370
1371
def line_iter(xo, yo, xd, yd):
1372
    """ returns an iterator
1373
1374
    This iterator does not include the origin point.
1375
1376
    Args:
1377
        xo (int): X starting point.
1378
        yo (int): Y starting point.
1379
        xd (int): X destination point.
1380
        yd (int): Y destination point.
1381
1382
    Returns:
1383
        Iterator[Tuple[int,int]]: An iterator of (x,y) points.
1384
    """
1385
    data = ffi.new('TCOD_bresenham_data_t *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1386
    lib.TCOD_line_init_mt(xo, yo, xd, yd, data)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_line_init_mt.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1387
    x = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1388
    y = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1389
    done = False
0 ignored issues
show
Unused Code introduced by
The variable done seems to be unused.
Loading history...
1390
    while not lib.TCOD_line_step_mt(x, y, data):
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_line_step_mt.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1391
        yield (x[0], y[0])
1392
1393
FOV_BASIC = 0
1394
FOV_DIAMOND = 1
1395
FOV_SHADOW = 2
1396
FOV_PERMISSIVE_0 = 3
1397
FOV_PERMISSIVE_1 = 4
1398
FOV_PERMISSIVE_2 = 5
1399
FOV_PERMISSIVE_3 = 6
1400
FOV_PERMISSIVE_4 = 7
1401
FOV_PERMISSIVE_5 = 8
1402
FOV_PERMISSIVE_6 = 9
1403
FOV_PERMISSIVE_7 = 10
1404
FOV_PERMISSIVE_8 = 11
1405
FOV_RESTRICTIVE = 12
1406
NB_FOV_ALGORITHMS = 13
1407
1408
def map_new(w, h):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1409
    return ffi.gc(lib.TCOD_map_new(w, h), lib.TCOD_map_delete)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_map_new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_map_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1410
1411
def map_copy(source, dest):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1412
    return lib.TCOD_map_copy(source, dest)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_map_copy.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1413
1414
def map_set_properties(m, x, y, isTrans, isWalk):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1415
    lib.TCOD_map_set_properties(m, x, y, isTrans, isWalk)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_map_set_properties.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1416
1417
def map_clear(m,walkable=False,transparent=False):
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
def map_clear(m,walkable=False,transparent=False):
^
Loading history...
Coding Style introduced by
Exactly one space required after comma
def map_clear(m,walkable=False,transparent=False):
^
Loading history...
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1418
    lib.TCOD_map_clear(m, walkable, transparent)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_map_clear.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1419
1420
def map_compute_fov(m, x, y, radius=0, light_walls=True, algo=FOV_RESTRICTIVE ):
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (80/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
Coding Style introduced by
No space allowed before bracket
def map_compute_fov(m, x, y, radius=0, light_walls=True, algo=FOV_RESTRICTIVE ):
^
Loading history...
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1421
    lib.TCOD_map_compute_fov(m, x, y, radius, light_walls, algo)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_map_compute_fov.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1422
1423
def map_is_in_fov(m, x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1424
    return lib.TCOD_map_is_in_fov(m, x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_map_is_in_fov.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1425
1426
def map_is_transparent(m, x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1427
    return lib.TCOD_map_is_transparent(m, x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_map_is_transparent.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1428
1429
def map_is_walkable(m, x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1430
    return lib.TCOD_map_is_walkable(m, x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_map_is_walkable.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1431
1432
def map_delete(m):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The argument m seems to be unused.
Loading history...
1433
    pass
1434
1435
def map_get_width(map):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Bug Best Practice introduced by
This seems to re-define the built-in map.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
1436
    return lib.TCOD_map_get_width(map)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_map_get_width.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1437
1438
def map_get_height(map):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Bug Best Practice introduced by
This seems to re-define the built-in map.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
1439
    return lib.TCOD_map_get_height(map)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_map_get_height.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1440
1441
def mouse_show_cursor(visible):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1442
    lib.TCOD_mouse_show_cursor(visible)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_mouse_show_cursor.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1443
1444
def mouse_is_cursor_visible():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1445
    return lib.TCOD_mouse_is_cursor_visible()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_mouse_is_cursor_visible.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1446
1447
def mouse_move(x, y):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1448
    lib.TCOD_mouse_move(x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_mouse_move.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1449
1450
def mouse_get_status():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1451
    return Mouse(lib.TCOD_mouse_get_status())
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_mouse_get_status.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1452
1453
def namegen_parse(filename,random=None):
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
def namegen_parse(filename,random=None):
^
Loading history...
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1454
    lib.TCOD_namegen_parse(_bytes(filename), random or ffi.NULL)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_namegen_parse.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1455
1456
def namegen_generate(name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1457
    return _unpack_char_p(lib.TCOD_namegen_generate(_bytes(name), False))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_namegen_generate.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1458
1459
def namegen_generate_custom(name, rule):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1460
    return _unpack_char_p(lib.TCOD_namegen_generate(_bytes(name),
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_namegen_generate.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1461
                                                     _bytes(rule), False))
1462
1463
def namegen_get_sets():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1464
    sets = lib.TCOD_namegen_get_sets()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_namegen_get_sets.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1465
    try:
1466
        lst = []
1467
        while not lib.TCOD_list_is_empty(sets):
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_list_is_empty.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1468
            lst.append(_unpack_char_p(ffi.cast('char *', lib.TCOD_list_pop(sets))))
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (83/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named cast.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_list_pop.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1469
    finally:
1470
        lib.TCOD_list_delete(sets)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_list_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1471
    return lst
1472
1473
def namegen_destroy():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1474
    lib.TCOD_namegen_destroy()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_namegen_destroy.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1475
1476
def noise_new(dim, h=NOISE_DEFAULT_HURST, l=NOISE_DEFAULT_LACUNARITY,
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1477
        random=None):
1478
    return ffi.gc(lib.TCOD_noise_new(dim, h, l, random or ffi.NULL),
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_noise_new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1479
                   lib.TCOD_noise_delete)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_noise_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1480
1481
def noise_set_type(n, typ):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1482
    lib.TCOD_noise_set_type(n,typ)
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
lib.TCOD_noise_set_type(n,typ)
^
Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_noise_set_type.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1483
1484
def noise_get(n, f, typ=NOISE_DEFAULT):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1485
    return lib.TCOD_noise_get_ex(n, ffi.new('float[]', f), typ)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_noise_get_ex.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1486
1487
def noise_get_fbm(n, f, oc, typ=NOISE_DEFAULT):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1488
    return lib.TCOD_noise_get_fbm_ex(n, ffi.new('float[]', f), oc, typ)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_noise_get_fbm_ex.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1489
1490
def noise_get_turbulence(n, f, oc, typ=NOISE_DEFAULT):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1491
    return lib.TCOD_noise_get_turbulence_ex(n, ffi.new('float[]', f), oc, typ)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_noise_get_turbulence_ex.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1492
1493
def noise_delete(n):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The argument n seems to be unused.
Loading history...
1494
    pass
1495
1496
_chr = chr
1497
try:
1498
    _chr = unichr # Python 2
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'unichr'
Loading history...
1499
except NameError:
0 ignored issues
show
Unused Code introduced by
This except handler seems to be unused and could be removed.

Except handlers which only contain pass and do not have an else clause can usually simply be removed:

try:
    raises_exception()
except:  # Could be removed
    pass
Loading history...
1500
    pass
1501
1502
def _unpack_union(type, union):
0 ignored issues
show
Bug Best Practice introduced by
This seems to re-define the built-in type.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
1503
    '''
1504
        unpack items from parser new_property (value_converter)
1505
    '''
1506
    if type == lib.TCOD_TYPE_BOOL:
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_TYPE_BOOL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1507
        return bool(union.b)
1508
    elif type == lib.TCOD_TYPE_CHAR:
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_TYPE_CHAR.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1509
        return _unicode(union.c)
1510
    elif type == lib.TCOD_TYPE_INT:
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_TYPE_INT.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1511
        return union.i
1512
    elif type == lib.TCOD_TYPE_FLOAT:
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_TYPE_FLOAT.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1513
        return union.f
1514
    elif (type == lib.TCOD_TYPE_STRING or
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_TYPE_STRING.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1515
         lib.TCOD_TYPE_VALUELIST15 >= type >= lib.TCOD_TYPE_VALUELIST00):
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_TYPE_VALUELIST15.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_TYPE_VALUELIST00.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1516
         return _unpack_char_p(union.s)
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 9 were found.
Loading history...
1517
    elif type == lib.TCOD_TYPE_COLOR:
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_TYPE_COLOR.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1518
        return Color._new_from_cdata(union.col)
1519
    elif type == lib.TCOD_TYPE_DICE:
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_TYPE_DICE.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1520
        return Dice(union.dice)
1521
    elif type & lib.TCOD_TYPE_LIST:
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_TYPE_LIST.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1522
        return _convert_TCODList(union.list, type & 0xFF)
1523
    else:
1524
        raise RuntimeError('Unknown libtcod type: %i' % type)
1525
1526
def _convert_TCODList(clist, type):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Bug Best Practice introduced by
This seems to re-define the built-in type.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
1527
    return [_unpack_union(type, lib.TDL_list_get_union(clist, i))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TDL_list_get_union.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1528
            for i in range(lib.TCOD_list_size(clist))]
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_list_size.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1529
1530
def parser_new():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1531
    return ffi.gc(lib.TCOD_parser_new(), lib.TCOD_parser_delete)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1532
1533
def parser_new_struct(parser, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1534
    return lib.TCOD_parser_new_struct(parser, name)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_new_struct.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1535
1536
# prevent multiple threads from messing with def_extern callbacks
1537
_parser_callback_lock = _threading.Lock()
1538
1539
def parser_run(parser, filename, listener=None):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1540
    if not listener:
1541
        lib.TCOD_parser_run(parser, _bytes(filename), ffi.NULL)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_run.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1542
        return
1543
1544
    propagate_manager = _PropagateException()
1545
    propagate = propagate_manager.propagate
1546
1547
    with _parser_callback_lock:
1548
        clistener = ffi.new('TCOD_parser_listener_t *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1549
1550
        @ffi.def_extern(onerror=propagate)
1551
        def pycall_parser_new_struct(struct, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1552
            return listener.end_struct(struct, _unpack_char_p(name))
1553
1554
        @ffi.def_extern(onerror=propagate)
1555
        def pycall_parser_new_flag(name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1556
            return listener.new_flag(_unpack_char_p(name))
1557
1558
        @ffi.def_extern(onerror=propagate)
1559
        def pycall_parser_new_property(propname, type, value):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Bug Best Practice introduced by
This seems to re-define the built-in type.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
1560
            return listener.new_property(_unpack_char_p(propname), type,
1561
                                         _unpack_union(type, value))
1562
1563
        @ffi.def_extern(onerror=propagate)
1564
        def pycall_parser_end_struct(struct, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1565
            return listener.end_struct(struct, _unpack_char_p(name))
1566
1567
        @ffi.def_extern(onerror=propagate)
1568
        def pycall_parser_error(msg):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1569
            listener.error(_unpack_char_p(msg))
1570
1571
        clistener.new_struct = lib.pycall_parser_new_struct
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named pycall_parser_new_struct.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1572
        clistener.new_flag = lib.pycall_parser_new_flag
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named pycall_parser_new_flag.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1573
        clistener.new_property = lib.pycall_parser_new_property
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named pycall_parser_new_property.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1574
        clistener.end_struct = lib.pycall_parser_end_struct
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named pycall_parser_end_struct.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1575
        clistener.error = lib.pycall_parser_error
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named pycall_parser_error.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1576
1577
        with propagate_manager:
1578
            lib.TCOD_parser_run(parser, _bytes(filename), clistener)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_run.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1579
1580
def parser_delete(parser):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The argument parser seems to be unused.
Loading history...
1581
    pass
1582
1583
def parser_get_bool_property(parser, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1584
    return bool(lib.TCOD_parser_get_bool_property(parser, _bytes(name)))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_get_bool_property.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1585
1586
def parser_get_int_property(parser, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1587
    return lib.TCOD_parser_get_int_property(parser, _bytes(name))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_get_int_property.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1588
1589
def parser_get_char_property(parser, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1590
    return _chr(lib.TCOD_parser_get_char_property(parser, _bytes(name)))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_get_char_property.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1591
1592
def parser_get_float_property(parser, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1593
    return lib.TCOD_parser_get_float_property(parser, _bytes(name))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_get_float_property.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1594
1595
def parser_get_string_property(parser, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1596
    return _unpack_char_p(
1597
        lib.TCOD_parser_get_string_property(parser, _bytes(name)))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_get_string_property.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1598
1599
def parser_get_color_property(parser, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1600
    return Color._new_from_cdata(
1601
        lib.TCOD_parser_get_color_property(parser, _bytes(name)))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_get_color_property.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1602
1603
def parser_get_dice_property(parser, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1604
    d = ffi.new('TCOD_dice_t *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1605
    lib.TCOD_parser_get_dice_property_py(parser, _bytes(name), d)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_get_dice_property_py.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1606
    return Dice(d)
1607
1608
def parser_get_list_property(parser, name, type):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Bug Best Practice introduced by
This seems to re-define the built-in type.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
1609
    clist = lib.TCOD_parser_get_list_property(parser, _bytes(name), type)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_parser_get_list_property.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1610
    return _convert_TCODList(clist, type)
1611
1612
RNG_MT = 0
1613
RNG_CMWC = 1
1614
1615
DISTRIBUTION_LINEAR = 0
1616
DISTRIBUTION_GAUSSIAN = 1
1617
DISTRIBUTION_GAUSSIAN_RANGE = 2
1618
DISTRIBUTION_GAUSSIAN_INVERSE = 3
1619
DISTRIBUTION_GAUSSIAN_RANGE_INVERSE = 4
1620
1621
def random_get_instance():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1622
    return lib.TCOD_random_get_instance()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_get_instance.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1623
1624
def random_new(algo=RNG_CMWC):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1625
    return ffi.gc(lib.TCOD_random_new(algo), lib.TCOD_random_delete)
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1626
1627
def random_new_from_seed(seed, algo=RNG_CMWC):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1628
    return ffi.gc(lib.TCOD_random_new_from_seed(algo, seed),
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_new_from_seed.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1629
                   lib.TCOD_random_delete)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1630
1631
def random_set_distribution(rnd, dist):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1632
	lib.TCOD_random_set_distribution(rnd or ffi.NULL, dist)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_set_distribution.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1633
1634
def random_get_int(rnd, mi, ma):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1635
    return lib.TCOD_random_get_int(rnd or ffi.NULL, mi, ma)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_get_int.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1636
1637
def random_get_float(rnd, mi, ma):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1638
    return lib.TCOD_random_get_float(rnd or ffi.NULL, mi, ma)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_get_float.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1639
1640
def random_get_double(rnd, mi, ma):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1641
    return lib.TCOD_random_get_double(rnd or ffi.NULL, mi, ma)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_get_double.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1642
1643
def random_get_int_mean(rnd, mi, ma, mean):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1644
    return lib.TCOD_random_get_int_mean(rnd or ffi.NULL, mi, ma, mean)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_get_int_mean.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1645
1646
def random_get_float_mean(rnd, mi, ma, mean):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1647
    return lib.TCOD_random_get_float_mean(rnd or ffi.NULL, mi, ma, mean)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_get_float_mean.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1648
1649
def random_get_double_mean(rnd, mi, ma, mean):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1650
    return lib.TCOD_random_get_double_mean(rnd or ffi.NULL, mi, ma, mean)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_get_double_mean.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1651
1652
def random_save(rnd):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1653
    return ffi.gc(lib.TCOD_random_save(rnd or ffi.NULL),
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named gc.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_save.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1654
                   lib.TCOD_random_delete)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_delete.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1655
1656
def random_restore(rnd, backup):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1657
    lib.TCOD_random_restore(rnd or ffi.NULL, backup)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_random_restore.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1658
1659
def random_delete(rnd):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The argument rnd seems to be unused.
Loading history...
1660
    pass
1661
1662
def struct_add_flag(struct, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1663
    lib.TCOD_struct_add_flag(struct, name)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_struct_add_flag.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1664
1665
def struct_add_property(struct, name, typ, mandatory):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1666
    lib.TCOD_struct_add_property(struct, name, typ, mandatory)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_struct_add_property.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1667
1668
def struct_add_value_list(struct, name, value_list, mandatory):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1669
    CARRAY = c_char_p * (len(value_list) + 1)
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'c_char_p'
Loading history...
1670
    cvalue_list = CARRAY()
1671
    for i in range(len(value_list)):
1672
        cvalue_list[i] = cast(value_list[i], c_char_p)
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'cast'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'c_char_p'
Loading history...
1673
    cvalue_list[len(value_list)] = 0
1674
    lib.TCOD_struct_add_value_list(struct, name, cvalue_list, mandatory)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_struct_add_value_list.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1675
1676
def struct_add_list_property(struct, name, typ, mandatory):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1677
    lib.TCOD_struct_add_list_property(struct, name, typ, mandatory)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_struct_add_list_property.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1678
1679
def struct_add_structure(struct, sub_struct):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1680
    lib.TCOD_struct_add_structure(struct, sub_struct)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_struct_add_structure.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1681
1682
def struct_get_name(struct):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1683
    return _unpack_char_p(lib.TCOD_struct_get_name(struct))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_struct_get_name.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1684
1685
def struct_is_mandatory(struct, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1686
    return lib.TCOD_struct_is_mandatory(struct, name)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_struct_is_mandatory.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1687
1688
def struct_get_type(struct, name):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
1689
    return lib.TCOD_struct_get_type(struct, name)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_struct_get_type.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1690
1691
# high precision time functions
1692
def sys_set_fps(fps):
1693
    """Set the maximum frame rate.
1694
1695
    You can disable the frame limit again by setting fps to 0.
1696
1697
    Args:
1698
        fps (int): A frame rate limit (i.e. 60)
1699
    """
1700
    lib.TCOD_sys_set_fps(fps)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_set_fps.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1701
1702
def sys_get_fps():
1703
    """Return the current frames per second.
1704
1705
    This the actual frame rate, not the frame limit set by
1706
    :any:`tcod.sys_set_fps`.
1707
1708
    This number is updated every second.
1709
1710
    Returns:
1711
        int: The currently measured frame rate.
1712
    """
1713
    return lib.TCOD_sys_get_fps()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_get_fps.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1714
1715
def sys_get_last_frame_length():
1716
    """Return the delta time of the last rendered frame in seconds.
1717
1718
    Returns:
1719
        float: The delta time of the last rendered frame.
1720
    """
1721
    return lib.TCOD_sys_get_last_frame_length()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_get_last_frame_length.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1722
1723
def sys_sleep_milli(val):
1724
    """Sleep for 'val' milliseconds.
1725
1726
    Args:
1727
        val (int): Time to sleep for in milliseconds.
1728
1729
    .. deprecated:: 2.0
1730
       Use :any:`time.sleep` instead.
1731
    """
1732
    lib.TCOD_sys_sleep_milli(val)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_sleep_milli.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1733
1734
def sys_elapsed_milli():
1735
    """Get number of milliseconds since the start of the program.
1736
1737
    Returns:
1738
        int: Time since the progeam has started in milliseconds.
1739
1740
    .. deprecated:: 2.0
1741
       Use :any:`time.clock` instead.
1742
    """
1743
    return lib.TCOD_sys_elapsed_milli()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_elapsed_milli.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1744
1745
def sys_elapsed_seconds():
1746
    """Get number of seconds since the start of the program.
1747
1748
    Returns:
1749
        float: Time since the progeam has started in seconds.
1750
1751
    .. deprecated:: 2.0
1752
       Use :any:`time.clock` instead.
1753
    """
1754
    return lib.TCOD_sys_elapsed_seconds()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_elapsed_seconds.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1755
1756
def sys_set_renderer(renderer):
1757
    """Change the current rendering mode to renderer.
1758
1759
    .. deprecated:: 2.0
1760
       RENDERER_GLSL and RENDERER_OPENGL are not currently available.
1761
    """
1762
    lib.TCOD_sys_set_renderer(renderer)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_set_renderer.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1763
1764
def sys_get_renderer():
1765
    """Return the current rendering mode.
1766
1767
    """
1768
    return lib.TCOD_sys_get_renderer()
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_get_renderer.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1769
1770
# easy screenshots
1771
def sys_save_screenshot(name=None):
1772
    """Save a screenshot to a file.
1773
1774
    By default this will automatically save screenshots in the working
1775
    directory.
1776
1777
    The automatic names are formatted as screenshotNNN.png.  For example:
1778
    screenshot000.png, screenshot001.png, etc.  Whichever is available first.
1779
1780
    Args:
1781
        file Optional[AnyStr]: File path to save screenshot.
1782
    """
1783
    if name is not None:
1784
        name = _bytes(name)
1785
    lib.TCOD_sys_save_screenshot(name or ffi.NULL)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_save_screenshot.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of _MockFFI does not seem to have a member named NULL.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1786
1787
# custom fullscreen resolution
1788
def sys_force_fullscreen_resolution(width, height):
1789
    """Force a specific resolution in fullscreen.
1790
1791
    Will use the smallest available resolution so that:
1792
1793
    * resolution width >= width and
1794
      resolution width >= root console width * font char width
1795
    * resolution height >= height and
1796
      resolution height >= root console height * font char height
1797
1798
    Args:
1799
        width (int): The desired resolution width.
1800
        height (int): The desired resolution height.
1801
    """
1802
    lib.TCOD_sys_force_fullscreen_resolution(width, height)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_force_fullscreen_resolution.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1803
1804
def sys_get_current_resolution():
1805
    """Return the current resolution as (width, height)
1806
1807
    Returns:
1808
        Tuple[int,int]: The current resolution.
1809
    """
1810
    w = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1811
    h = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1812
    lib.TCOD_sys_get_current_resolution(w, h)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_get_current_resolution.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1813
    return w[0], h[0]
1814
1815
def sys_get_char_size():
1816
    """Return the current fonts character size as (width, height)
1817
1818
    Returns:
1819
        Tuple[int,int]: The current font glyph size in (width, height)
1820
    """
1821
    w = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1822
    h = ffi.new('int *')
0 ignored issues
show
Bug introduced by
The Instance of _MockFFI does not seem to have a member named new.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1823
    lib.TCOD_sys_get_char_size(w, h)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_get_char_size.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1824
    return w[0], h[0]
1825
1826
# update font bitmap
1827
def sys_update_char(asciiCode, fontx, fonty, img, x, y):
1828
    """Dynamically update the current frot with img.
1829
1830
    All cells using this asciiCode will be updated
1831
    at the next call to :any:`tcod.console_flush`.
1832
1833
    Args:
1834
        asciiCode (int): Ascii code corresponding to the character to update.
1835
        fontx (int): Left coordinate of the character
1836
                     in the bitmap font (in tiles)
1837
        fonty (int): Top coordinate of the character
1838
                     in the bitmap font (in tiles)
1839
        img (Image): An image containing the new character bitmap.
1840
        x (int): Left pixel of the character in the image.
1841
        y (int): Top pixel of the character in the image.
1842
    """
1843
    lib.TCOD_sys_update_char(_int(asciiCode), fontx, fonty, img, x, y)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_update_char.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1844
1845
def sys_register_SDL_renderer(callback):
1846
    """Register a custom randering function with libtcod.
1847
1848
    The callack will receive a :any:`CData <ffi-cdata>` void* to an
1849
    SDL_Surface* struct.
1850
1851
    The callback is called on every call to :any:`tcod.console_flush`.
1852
1853
    Args:
1854
        callback Callable[[CData], None]:
1855
            A function which takes a single argument.
1856
    """
1857
    with _PropagateException() as propagate:
1858
        @ffi.def_extern(onerror=propagate)
1859
        def _pycall_sdl_hook(sdl_surface):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The variable _pycall_sdl_hook seems to be unused.
Loading history...
1860
            callback(sdl_surface)
1861
        lib.TCOD_sys_register_SDL_renderer(lib._pycall_sdl_hook)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_register_SDL_renderer.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of object does not seem to have a member named _pycall_sdl_hook.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1862
1863
def sys_check_for_event(mask, k, m):
1864
    """Check for and return an event.
1865
1866
    Args:
1867
        mask (int): :any:`Event types` to wait for.
1868
        k (Optional[Key]): A tcod.Key instance which might be updated with
1869
                           an event.  Can be None.
1870
        m (Optional[Mouse]): A tcod.Mouse instance which might be updated
1871
                             with an event.  Can be None.
1872
    """
1873
    return lib.TCOD_sys_check_for_event(mask, _cdata(k), _cdata(m))
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_check_for_event.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1874
1875
def sys_wait_for_event(mask, k, m, flush):
1876
    """Wait for an event then return.
1877
1878
    If flush is True then the buffer will be cleared before waiting. Otherwise
1879
    each available event will be returned in the order they're recieved.
1880
1881
    Args:
1882
        mask (int): :any:`Event types` to wait for.
1883
        k (Optional[Key]): A tcod.Key instance which might be updated with
1884
                           an event.  Can be None.
1885
        m (Optional[Mouse]): A tcod.Mouse instance which might be updated
1886
                             with an event.  Can be None.
1887
        flush (bool): Clear the event buffer before waiting.
1888
    """
1889
    return lib.TCOD_sys_wait_for_event(mask, _cdata(k), _cdata(m), flush)
0 ignored issues
show
Bug introduced by
The Instance of object does not seem to have a member named TCOD_sys_wait_for_event.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
1890
1891
__all__ = [_name for _name in list(globals()) if _name[0] != '_']
1892