@@ -2,56 +2,56 @@ package ceramic.scriptable;
22
33/**
44 * Scriptable wrapper for Flags to expose bit flag operations to scripts.
5- *
5+ *
66 * This class provides utility methods for working with bit flags, which are
77 * commonly used to store multiple boolean values in a single integer.
88 * In scripts, this type is exposed as `Flags` (without the Scriptable prefix).
9- *
9+ *
1010 * Bit flags allow efficient storage of up to 32 boolean values in a single
1111 * integer, where each bit position represents a different flag.
12- *
12+ *
1313 * ## Usage in Scripts
14- *
15- * ```hscript
14+ *
15+ * ```haxe
1616 * // Define flag positions as constants
1717 * var FLAG_ACTIVE = 0; // Bit 0
1818 * var FLAG_VISIBLE = 1; // Bit 1
1919 * var FLAG_ENABLED = 2; // Bit 2
20- *
20+ *
2121 * // Start with no flags set
2222 * var flags = 0;
23- *
23+ *
2424 * // Set the ACTIVE flag to true
2525 * flags = Flags.setBoolAndGetFlags(flags, FLAG_ACTIVE, true);
26- *
26+ *
2727 * // Set multiple flags
2828 * flags = Flags.setBoolAndGetFlags(flags, FLAG_VISIBLE, true);
2929 * flags = Flags.setBoolAndGetFlags(flags, FLAG_ENABLED, false);
30- *
30+ *
3131 * // Check if a flag is set
3232 * if (Flags.getBool(flags, FLAG_ACTIVE)) {
3333 * trace("Object is active");
3434 * }
35- *
35+ *
3636 * // Toggle a flag
3737 * var isVisible = Flags.getBool(flags, FLAG_VISIBLE);
3838 * flags = Flags.setBoolAndGetFlags(flags, FLAG_VISIBLE, !isVisible);
3939 * ```
40- *
40+ *
4141 * ## Bit Positions
42- *
42+ *
4343 * - Bit 0: Rightmost bit, value 1
4444 * - Bit 1: Second bit, value 2
4545 * - Bit 2: Third bit, value 4
4646 * - And so on up to bit 31
47- *
47+ *
4848 * @see ceramic.Flags The actual implementation
4949 */
5050class ScriptableFlags {
5151
5252 /**
5353 * Check if a specific bit flag is set.
54- *
54+ *
5555 * @param flags The integer containing the bit flags
5656 * @param bit The bit position to check (0-31)
5757 * @return True if the bit is set (1), false if not set (0)
@@ -65,10 +65,10 @@ class ScriptableFlags {
6565
6666 /**
6767 * Set or clear a specific bit flag and return the updated flags value.
68- *
68+ *
6969 * This method does not modify the input flags parameter, but returns
7070 * a new integer with the specified bit updated.
71- *
71+ *
7272 * @param flags The integer containing the bit flags
7373 * @param bit The bit position to modify (0-31)
7474 * @param bool True to set the bit (1), false to clear it (0)
0 commit comments