adofaipy


Nameadofaipy JSON
Version 3.0.3 PyPI version JSON
download
home_page
SummaryA library that makes automating events in ADOFAI levels more convenient.
upload_time2024-03-18 11:51:37
maintainer
docs_urlNone
authorM1n3c4rt
requires_python
licenseMIT
keywords adofai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![](https://i.imgur.com/y6hOYx3.png)
This is a library that makes automating events in ADOFAI levels more convenient.
<br>List of Classes:<br>
<hr>
<i><code style="color : white">LevelDict</code></i>
<dl>
    Initalize with <code>LevelDict(filename, encoding)</code> (encoding is optional, default is utf-8-sig)<br>
    <br><dt><code>LevelDict.filename : str</code>
    <dd>The filename of the file from which the <code>LevelDict</code> was obtained.
    <dt><code>LevelDict.encoding : str</code>
    <dd>The encoding of the file from which the <code>LevelDict</code> was obtained.
    <dd>A list of all decorations (including objects and text) in the level.
    <dt><code>LevelDict.nonFloorDecos : list[Decoration]</code>
    <dd>A list of all decorations in the level that are not tied to any particular tile.
    <dt><code>LevelDict.settings : Settings</code>
    <dd>The level settings, as a Settings object.
    <dt><code>LevelDict.tiles : list[Tile]</code>
    <dd>A list of all tiles in the level. (See <code>Tile</code> class)</dd>
    <br><dt><code>LevelDict.appendTile(self, angle : float) -> None:</code>
    <dd>Adds a single tile to the end of the level.
    <dt><code>LevelDict.appendTiles(self, angles : list[float]) -> None:</code>
    <dd>Adds a list of tiles to the end of the level.
    <dt><code>LevelDict.insertTile(self, angle : float, index : int) -> None:</code>
    <dd>Adds a single tile to the level before the specified index.
    <dt><code>LevelDict.insertTiles(self, angles : list[float], index : int) -> None:</code>
    <dd>Adds a list of tiles to the level before the specified index.
    <dt><code>LevelDict.addAction(self, event : Action) -> int:</code>
    <dd>Adds the given action to the level. Returns the index of the event within the tile.
    <dt><code>LevelDict.addDecoration(self, event : Decoration) -> int:</code>
    <dd>Adds the given decoration to the level. Returns the index of the event within the tile / within the list of non-floor decorations.
    <dt><code>LevelDict.getActions(self, condition : Callable) -> list[Action]:</code>
    <dd>Returns a list of actions in the level that meet the given condition. Returns a list of all actions if condition is not specified.
    <dt><code>LevelDict.getDecorations(self, condition : Callable) -> list[Decoration]:</code>
    <dd>Returns a list of decorations in the level that meet the given condition. Returns a list of all decorations if condition is not specified.
    <dt><code>LevelDict.removeActions(self, condition : Callable) -> list[Action]:</code>
    <dd>Removes all actions in the level that meet the given condition. Returns a list of removed actions.
    <dt><code>LevelDict.removeDecorations(self, condition : Callable) -> list[Decoration]:</code>
    <dd>Removes all decorations in the level that meet the given condition. Returns a list of removed decorations.
    <dt><code>LevelDict.popAction(self, tile, index) -> Action:</code>
    <dd>Removes the action at the specified tile at the specified index. Returns the event.
    <dt><code>LevelDict.popDecoration(self, tile, index) -> Decoration:</code>
    <dd>Removes the decoration at the specified tile at the specified index. Returns the event.
    <dt><code>LevelDict.replaceFieldAction(self, condition : Callable, field : str, new) -> None:</code>
    <dd>Changes the value of "field" to "new" in all actions that meet the given condition.
    <dt><code>LevelDict.replaceFieldDecoration(self, condition : Callable, field : str, new) -> None:</code>
    <dd>Changes the value of "field" to "new" in all decorations that meet the given condition.
    <dt><code>LevelDict.writeDictToFile(self, leveldict : dict, filename : str):</code>
    <dd>Writes the given dictionary to the specified file. Overwrites the original file if filename is not specified.
    <br><i>Use this if you are working with <code>LevelDict.leveldict</code>.</i>
    <dt><code>LevelDict.writeToFile(self, filename : str=None) -> None:</code>
    <dd>Writes the level to the specified file. Overwrites the original file if filename is not specified.
</dl>
<hr>
<i><code style="color : white">Settings</code></i><br>
Part of a LevelDict object. The properties of this class are equivalent to the parameters in the <code>settings</code> field of a .adofai file.
<hr>
<i><code style="color : white">Tile</code></i><br>
A list of Tiles is contained within a LevelDict object.
<dl>
    <dt><code>Tile.angle : float</code>
    <dd>The angle that the tile points towards (0 degrees is facing right, 90 degrees is facing upwards)
    <dt><code>Tile.actions : list[Action]</code>
    <dd>A list of actions which are present on that particular tile.
    <dt><code>Tile.decorations : list[Decoration]</code>
    <dd>A list of decorations which are present on that particular tile.
</dl>
<hr>
<i><code style="color : white">Action</code></i><br>
An event that goes on a tile (one with a purple icon). An <code> Action </code> object behaves like a <code>dict</code>. The keys depend on the event type. Check any entry in the <code>actions</code> field of a .adofai file for more information on the fields used by that event type.
<br><br>
Action objects are found in a list of actions in a <code>Tile</code> object.
<hr>
<i><code style="color : white">Decoration</code></i><br>
A decoration, object decoration, or text decoration (anything found in the decorations menu on the left sidebar). A <code> Decoration</code> object behaves like a <code>dict</code>. The keys depend on the event type. Check any entry in the <code>decorations</code> field of a .adofai file for more information on the fields used by that event type.
<br><br>
Decoration objects are found in a list of decorations in a <code>Tile</code> object. If the decoration is not tied to any tile, it is found in the list of non-floor decos.
<hr><br>

<h1>Changelog</h1>

## 3.0.3 (2023/03/18)
------------------
- Minor bugfixes
- Fixed `writeToFile()` no longer working
- Replaced `json.dumps()` with faster `json.dump()` in `writeToFile()`
- Known issue: version number is out of sync

## 3.0.1 (2023/12/02)
------------------
- Minor bugfix
- Fixed markdown bug on README and CHANGELOG
- Removed unnessecary files

## 3.0.0 (2023/12/01)
------------------
- Major update
- Completely overhauled file structure to use a class-based system
- Too much to list! Read the docs for more info

## 2.0.3 (2023/09/23)
------------------
- Minor bugfixes
- Fixed `addEvent()` not detecting `addObject` and `addText` events
- Fixed `removeEvents()` not modifying `leveldict`
- Fixed typo in `replaceField()`
- Added logo to README

## 2.0.2 (2023/09/03)
------------------
- Minor bugfix
- Fixed markdown bug on README and CHANGELOG for real this time

## 2.0.1 (2023/09/03)
------------------
- Minor bugfix
- Fixed markdown bug on README and CHANGELOG (hopefully)

## 2.0.0 (2023/09/03)
------------------
- Major update
- Completely overhauled file reading to use dictionaries instead of strings
- Added `getFileDict()`
- Added 3 new utility functions: `searchEvents()`, `removeEvents()` and `replaceField()`
- `getAngles()`, `setAngles()` and all event functions are now deprecated
- Updated documentation
- README and CHANGELOG now uses markdown

## 0.1.1 (2023/07/17)
------------------
- Minor bugfixes
- Fixed encoding incompatibility
- Fixed output string for `moveDecorations()`

## 0.1.0 (2023/06/15)
------------------
- Minor update
- Added dynamic pivot offset, parallax offset, masking and blending fields to `addDecoration()` and `moveDecorations()`
- Added angleOffset to `setSpeed()`

## 0.0.3 (2023/06/14)
------------------
- Minor bugfix: fixed filename `__init__.py`

## 0.0.2 (2023/06/13)
------------------
- Minor bugfix: `'re'` is no longer a dependency

## 0.0.1 (2023/05/28)
------------------
- First Release


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "adofaipy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "adofai",
    "author": "M1n3c4rt",
    "author_email": "vedicbits@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0d/35/c390e694413239aa07b853eff8c0197611ee9cc62d56c53ea71b74d9f544/adofaipy-3.0.3.tar.gz",
    "platform": null,
    "description": "![](https://i.imgur.com/y6hOYx3.png)\r\nThis is a library that makes automating events in ADOFAI levels more convenient.\r\n<br>List of Classes:<br>\r\n<hr>\r\n<i><code style=\"color : white\">LevelDict</code></i>\r\n<dl>\r\n    Initalize with <code>LevelDict(filename, encoding)</code> (encoding is optional, default is utf-8-sig)<br>\r\n    <br><dt><code>LevelDict.filename : str</code>\r\n    <dd>The filename of the file from which the <code>LevelDict</code> was obtained.\r\n    <dt><code>LevelDict.encoding : str</code>\r\n    <dd>The encoding of the file from which the <code>LevelDict</code> was obtained.\r\n    <dd>A list of all decorations (including objects and text) in the level.\r\n    <dt><code>LevelDict.nonFloorDecos : list[Decoration]</code>\r\n    <dd>A list of all decorations in the level that are not tied to any particular tile.\r\n    <dt><code>LevelDict.settings : Settings</code>\r\n    <dd>The level settings, as a Settings object.\r\n    <dt><code>LevelDict.tiles : list[Tile]</code>\r\n    <dd>A list of all tiles in the level. (See <code>Tile</code> class)</dd>\r\n    <br><dt><code>LevelDict.appendTile(self, angle : float) -> None:</code>\r\n    <dd>Adds a single tile to the end of the level.\r\n    <dt><code>LevelDict.appendTiles(self, angles : list[float]) -> None:</code>\r\n    <dd>Adds a list of tiles to the end of the level.\r\n    <dt><code>LevelDict.insertTile(self, angle : float, index : int) -> None:</code>\r\n    <dd>Adds a single tile to the level before the specified index.\r\n    <dt><code>LevelDict.insertTiles(self, angles : list[float], index : int) -> None:</code>\r\n    <dd>Adds a list of tiles to the level before the specified index.\r\n    <dt><code>LevelDict.addAction(self, event : Action) -> int:</code>\r\n    <dd>Adds the given action to the level. Returns the index of the event within the tile.\r\n    <dt><code>LevelDict.addDecoration(self, event : Decoration) -> int:</code>\r\n    <dd>Adds the given decoration to the level. Returns the index of the event within the tile / within the list of non-floor decorations.\r\n    <dt><code>LevelDict.getActions(self, condition : Callable) -> list[Action]:</code>\r\n    <dd>Returns a list of actions in the level that meet the given condition. Returns a list of all actions if condition is not specified.\r\n    <dt><code>LevelDict.getDecorations(self, condition : Callable) -> list[Decoration]:</code>\r\n    <dd>Returns a list of decorations in the level that meet the given condition. Returns a list of all decorations if condition is not specified.\r\n    <dt><code>LevelDict.removeActions(self, condition : Callable) -> list[Action]:</code>\r\n    <dd>Removes all actions in the level that meet the given condition. Returns a list of removed actions.\r\n    <dt><code>LevelDict.removeDecorations(self, condition : Callable) -> list[Decoration]:</code>\r\n    <dd>Removes all decorations in the level that meet the given condition. Returns a list of removed decorations.\r\n    <dt><code>LevelDict.popAction(self, tile, index) -> Action:</code>\r\n    <dd>Removes the action at the specified tile at the specified index. Returns the event.\r\n    <dt><code>LevelDict.popDecoration(self, tile, index) -> Decoration:</code>\r\n    <dd>Removes the decoration at the specified tile at the specified index. Returns the event.\r\n    <dt><code>LevelDict.replaceFieldAction(self, condition : Callable, field : str, new) -> None:</code>\r\n    <dd>Changes the value of \"field\" to \"new\" in all actions that meet the given condition.\r\n    <dt><code>LevelDict.replaceFieldDecoration(self, condition : Callable, field : str, new) -> None:</code>\r\n    <dd>Changes the value of \"field\" to \"new\" in all decorations that meet the given condition.\r\n    <dt><code>LevelDict.writeDictToFile(self, leveldict : dict, filename : str):</code>\r\n    <dd>Writes the given dictionary to the specified file. Overwrites the original file if filename is not specified.\r\n    <br><i>Use this if you are working with <code>LevelDict.leveldict</code>.</i>\r\n    <dt><code>LevelDict.writeToFile(self, filename : str=None) -> None:</code>\r\n    <dd>Writes the level to the specified file. Overwrites the original file if filename is not specified.\r\n</dl>\r\n<hr>\r\n<i><code style=\"color : white\">Settings</code></i><br>\r\nPart of a LevelDict object. The properties of this class are equivalent to the parameters in the <code>settings</code> field of a .adofai file.\r\n<hr>\r\n<i><code style=\"color : white\">Tile</code></i><br>\r\nA list of Tiles is contained within a LevelDict object.\r\n<dl>\r\n    <dt><code>Tile.angle : float</code>\r\n    <dd>The angle that the tile points towards (0 degrees is facing right, 90 degrees is facing upwards)\r\n    <dt><code>Tile.actions : list[Action]</code>\r\n    <dd>A list of actions which are present on that particular tile.\r\n    <dt><code>Tile.decorations : list[Decoration]</code>\r\n    <dd>A list of decorations which are present on that particular tile.\r\n</dl>\r\n<hr>\r\n<i><code style=\"color : white\">Action</code></i><br>\r\nAn event that goes on a tile (one with a purple icon). An <code> Action </code> object behaves like a <code>dict</code>. The keys depend on the event type. Check any entry in the <code>actions</code> field of a .adofai file for more information on the fields used by that event type.\r\n<br><br>\r\nAction objects are found in a list of actions in a <code>Tile</code> object.\r\n<hr>\r\n<i><code style=\"color : white\">Decoration</code></i><br>\r\nA decoration, object decoration, or text decoration (anything found in the decorations menu on the left sidebar). A <code> Decoration</code> object behaves like a <code>dict</code>. The keys depend on the event type. Check any entry in the <code>decorations</code> field of a .adofai file for more information on the fields used by that event type.\r\n<br><br>\r\nDecoration objects are found in a list of decorations in a <code>Tile</code> object. If the decoration is not tied to any tile, it is found in the list of non-floor decos.\r\n<hr><br>\r\n\r\n<h1>Changelog</h1>\r\n\r\n## 3.0.3 (2023/03/18)\r\n------------------\r\n- Minor bugfixes\r\n- Fixed `writeToFile()` no longer working\r\n- Replaced `json.dumps()` with faster `json.dump()` in `writeToFile()`\r\n- Known issue: version number is out of sync\r\n\r\n## 3.0.1 (2023/12/02)\r\n------------------\r\n- Minor bugfix\r\n- Fixed markdown bug on README and CHANGELOG\r\n- Removed unnessecary files\r\n\r\n## 3.0.0 (2023/12/01)\r\n------------------\r\n- Major update\r\n- Completely overhauled file structure to use a class-based system\r\n- Too much to list! Read the docs for more info\r\n\r\n## 2.0.3 (2023/09/23)\r\n------------------\r\n- Minor bugfixes\r\n- Fixed `addEvent()` not detecting `addObject` and `addText` events\r\n- Fixed `removeEvents()` not modifying `leveldict`\r\n- Fixed typo in `replaceField()`\r\n- Added logo to README\r\n\r\n## 2.0.2 (2023/09/03)\r\n------------------\r\n- Minor bugfix\r\n- Fixed markdown bug on README and CHANGELOG for real this time\r\n\r\n## 2.0.1 (2023/09/03)\r\n------------------\r\n- Minor bugfix\r\n- Fixed markdown bug on README and CHANGELOG (hopefully)\r\n\r\n## 2.0.0 (2023/09/03)\r\n------------------\r\n- Major update\r\n- Completely overhauled file reading to use dictionaries instead of strings\r\n- Added `getFileDict()`\r\n- Added 3 new utility functions: `searchEvents()`, `removeEvents()` and `replaceField()`\r\n- `getAngles()`, `setAngles()` and all event functions are now deprecated\r\n- Updated documentation\r\n- README and CHANGELOG now uses markdown\r\n\r\n## 0.1.1 (2023/07/17)\r\n------------------\r\n- Minor bugfixes\r\n- Fixed encoding incompatibility\r\n- Fixed output string for `moveDecorations()`\r\n\r\n## 0.1.0 (2023/06/15)\r\n------------------\r\n- Minor update\r\n- Added dynamic pivot offset, parallax offset, masking and blending fields to `addDecoration()` and `moveDecorations()`\r\n- Added angleOffset to `setSpeed()`\r\n\r\n## 0.0.3 (2023/06/14)\r\n------------------\r\n- Minor bugfix: fixed filename `__init__.py`\r\n\r\n## 0.0.2 (2023/06/13)\r\n------------------\r\n- Minor bugfix: `'re'` is no longer a dependency\r\n\r\n## 0.0.1 (2023/05/28)\r\n------------------\r\n- First Release\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A library that makes automating events in ADOFAI levels more convenient.",
    "version": "3.0.3",
    "project_urls": null,
    "split_keywords": [
        "adofai"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d35c390e694413239aa07b853eff8c0197611ee9cc62d56c53ea71b74d9f544",
                "md5": "5447813f93efb0fcedcb7ec22474ed38",
                "sha256": "0ade1402c8450c47bf68e289b322f530e87ec5be966dca4eacc7b9b8bbcf9cb7"
            },
            "downloads": -1,
            "filename": "adofaipy-3.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "5447813f93efb0fcedcb7ec22474ed38",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7820,
            "upload_time": "2024-03-18T11:51:37",
            "upload_time_iso_8601": "2024-03-18T11:51:37.390152Z",
            "url": "https://files.pythonhosted.org/packages/0d/35/c390e694413239aa07b853eff8c0197611ee9cc62d56c53ea71b74d9f544/adofaipy-3.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-18 11:51:37",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "adofaipy"
}
        
Elapsed time: 0.20859s