uniqueNew = new HashSet<>(newInRange),
103 | uniqueOld = new HashSet<>(oldInRange);
104 | uniqueNew.removeAll(oldInRange);
105 | uniqueOld.removeAll(newInRange);
106 |
107 | for (CombatEntityAPI entity : uniqueNew)
108 | {
109 | engine.addSmokeParticle(entity.getLocation(), entity.getVelocity(), entity.getCollisionRadius(), 0.5f, 0.5f, Color.GREEN);
110 | System.out.println("Only in new method: " + entity + " | Distance: " + MathUtils.getDistance(player, entity) +
111 | " (real: " + MathUtils.getDistance(player.getLocation(), entity.getLocation()) + ")");
112 | }
113 |
114 | for (CombatEntityAPI entity : uniqueOld)
115 | {
116 | engine.addSmokeParticle(entity.getLocation(), entity.getVelocity(), entity.getCollisionRadius(), 0.5f, 0.5f, Color.RED);
117 | System.out.println("Only in old method: " + entity + " | Distance: " + MathUtils.getDistance(player, entity) +
118 | " (real: " + MathUtils.getDistance(player.getLocation(), entity.getLocation()) + ")");
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/docs/allpackages-index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | All Packages
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | Package Summary
55 |
56 |
57 |
58 |
59 |
60 |
Contains general methods that mostly help with non-API data types.
61 |
62 |
63 |
64 |
Contains campaign helper classes.
65 |
66 |
67 |
70 |
71 |
72 |
Contains combat helper classes.
73 |
74 |
75 |
76 |
Contains instantiable combat entities.
77 |
78 |
79 |
80 |
Contains classes to help with drawing OpenGL primitives.
81 |
82 |
83 |
84 |
Contains classes and methods for rendering text and simple GUI elements.
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/docs/element-list:
--------------------------------------------------------------------------------
1 | org.lazywizard.lazylib
2 | org.lazywizard.lazylib.campaign
3 | org.lazywizard.lazylib.campaign.orbits
4 | org.lazywizard.lazylib.combat
5 | org.lazywizard.lazylib.combat.entities
6 | org.lazywizard.lazylib.opengl
7 | org.lazywizard.lazylib.ui
8 |
--------------------------------------------------------------------------------
/docs/jquery-ui.overrides.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Oracle designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Oracle in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 | * or visit www.oracle.com if you need additional information or have any
23 | * questions.
24 | */
25 |
26 | .ui-state-active,
27 | .ui-widget-content .ui-state-active,
28 | .ui-widget-header .ui-state-active,
29 | a.ui-button:active,
30 | .ui-button:active,
31 | .ui-button.ui-state-active:hover {
32 | /* Overrides the color of selection used in jQuery UI */
33 | background: #F8981D;
34 | border: 1px solid #F8981D;
35 | }
36 |
--------------------------------------------------------------------------------
/docs/legal/ADDITIONAL_LICENSE_INFO:
--------------------------------------------------------------------------------
1 | Please see ..\java.base\ADDITIONAL_LICENSE_INFO
2 |
--------------------------------------------------------------------------------
/docs/legal/ASSEMBLY_EXCEPTION:
--------------------------------------------------------------------------------
1 | Please see ..\java.base\ASSEMBLY_EXCEPTION
2 |
--------------------------------------------------------------------------------
/docs/legal/LICENSE:
--------------------------------------------------------------------------------
1 | Please see ..\java.base\LICENSE
2 |
--------------------------------------------------------------------------------
/docs/legal/jquery.md:
--------------------------------------------------------------------------------
1 | ## jQuery v3.7.1
2 |
3 | ### jQuery License
4 | ```
5 | jQuery v 3.7.1
6 | Copyright OpenJS Foundation and other contributors, https://openjsf.org/
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining
9 | a copy of this software and associated documentation files (the
10 | "Software"), to deal in the Software without restriction, including
11 | without limitation the rights to use, copy, modify, merge, publish,
12 | distribute, sublicense, and/or sell copies of the Software, and to
13 | permit persons to whom the Software is furnished to do so, subject to
14 | the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be
17 | included in all copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/legal/jqueryUI.md:
--------------------------------------------------------------------------------
1 | ## jQuery UI v1.13.2
2 |
3 | ### jQuery UI License
4 | ```
5 | Copyright jQuery Foundation and other contributors, https://jquery.org/
6 |
7 | This software consists of voluntary contributions made by many
8 | individuals. For exact contribution history, see the revision history
9 | available at https://github.com/jquery/jquery-ui
10 |
11 | The following license applies to all parts of this software except as
12 | documented below:
13 |
14 | ====
15 |
16 | Permission is hereby granted, free of charge, to any person obtaining
17 | a copy of this software and associated documentation files (the
18 | "Software"), to deal in the Software without restriction, including
19 | without limitation the rights to use, copy, modify, merge, publish,
20 | distribute, sublicense, and/or sell copies of the Software, and to
21 | permit persons to whom the Software is furnished to do so, subject to
22 | the following conditions:
23 |
24 | The above copyright notice and this permission notice shall be
25 | included in all copies or substantial portions of the Software.
26 |
27 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
31 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
32 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
33 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 |
35 | ====
36 |
37 | Copyright and related rights for sample code are waived via CC0. Sample
38 | code is defined as all source code contained within the demos directory.
39 |
40 | CC0: http://creativecommons.org/publicdomain/zero/1.0/
41 |
42 | ====
43 |
44 | All files located in the node_modules and external directories are
45 | externally maintained libraries used by this software which have their
46 | own licenses; we recommend you read them, as their terms may differ from
47 | the terms above.
48 |
49 | ```
50 |
--------------------------------------------------------------------------------
/docs/module-search-index.js:
--------------------------------------------------------------------------------
1 | moduleSearchIndex = [];updateSearchResults();
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/campaign/class-use/CampaignUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.campaign.CampaignUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.campaign.CampaignUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/campaign/class-use/CargoUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.campaign.CargoUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.campaign.CargoUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/campaign/class-use/MessageUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.campaign.MessageUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.campaign.MessageUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/campaign/orbits/class-use/EllipticalOrbit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.campaign.orbits.EllipticalOrbit
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.campaign.orbits.EllipticalOrbit
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/campaign/orbits/package-summary.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | org.lazywizard.lazylib.campaign.orbits
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
57 |
58 |
59 |
62 |
63 | package org.lazywizard.lazylib.campaign.orbits
64 |
67 |
68 |
69 |
70 |
81 |
82 |
83 |
84 |
Classes
85 |
86 |
87 |
88 |
89 |
90 |
Represents an elliptical orbit path.
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/campaign/orbits/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | org.lazywizard.lazylib.campaign.orbits Class Hierarchy
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
58 |
59 | Class Hierarchy
60 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/campaign/orbits/package-use.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Package org.lazywizard.lazylib.campaign.orbits
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.campaign.orbits
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/campaign/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | org.lazywizard.lazylib.campaign Class Hierarchy
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
58 |
59 | Class Hierarchy
60 |
69 |
70 |
71 | Enum Class Hierarchy
72 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/campaign/package-use.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Package org.lazywizard.lazylib.campaign
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
Contains campaign helper classes.
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
Controls what
RepLevel
s will be accepted by methods that check
74 | reputation relative to the
RepLevel
passed in.
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/CollectionUtils.SortEntitiesByDistance.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.CollectionUtils.SortEntitiesByDistance
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.CollectionUtils.SortEntitiesByDistance
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/CollectionUtils.SortTokensByDistance.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.CollectionUtils.SortTokensByDistance
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.CollectionUtils.SortTokensByDistance
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/CollectionUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.CollectionUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.CollectionUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/CollisionUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.CollisionUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.CollisionUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/EllipseUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.EllipseUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.EllipseUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/FastTrig.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.FastTrig
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.FastTrig
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/IOUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.IOUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.IOUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/JSONUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.JSONUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.JSONUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/LazyLib.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.LazyLib
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.LazyLib
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/MathUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.MathUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.MathUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/ModUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.ModUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.ModUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/ShapeUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.ShapeUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.ShapeUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/StringUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.StringUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.StringUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/class-use/VectorUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.VectorUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.VectorUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/combat/class-use/AIUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.combat.AIUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.combat.AIUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/combat/class-use/CombatUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.combat.CombatUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.combat.CombatUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/combat/class-use/DefenseUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.combat.DefenseUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.combat.DefenseUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/combat/class-use/WeaponUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.combat.WeaponUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.combat.WeaponUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/combat/entities/class-use/AnchoredEntity.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.combat.entities.AnchoredEntity
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.combat.entities.AnchoredEntity
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/combat/entities/class-use/SimpleEntity.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.combat.entities.SimpleEntity
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.combat.entities.SimpleEntity
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/combat/entities/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | org.lazywizard.lazylib.combat.entities Class Hierarchy
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
58 |
59 | Class Hierarchy
60 |
68 |
69 |
70 | Enum Class Hierarchy
71 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/combat/entities/package-use.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Package org.lazywizard.lazylib.combat.entities
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
Contains instantiable combat entities.
61 |
62 |
63 |
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/combat/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | org.lazywizard.lazylib.combat Class Hierarchy
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
58 |
59 | Class Hierarchy
60 |
70 |
71 |
72 | Enum Class Hierarchy
73 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/combat/package-use.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Package org.lazywizard.lazylib.combat
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
Contains combat helper classes.
61 |
62 |
63 |
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/opengl/class-use/ColorUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.opengl.ColorUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.opengl.ColorUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/opengl/class-use/DrawUtils.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.opengl.DrawUtils
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.opengl.DrawUtils
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/opengl/package-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | org.lazywizard.lazylib.opengl Class Hierarchy
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
58 |
59 | Class Hierarchy
60 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/opengl/package-use.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Package org.lazywizard.lazylib.opengl
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 | No usage of org.lazywizard.lazylib.opengl
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/package-use.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Package org.lazywizard.lazylib
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
Contains general methods that mostly help with non-API data types.
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
77 |
78 |
79 |
Provides a wrapper around
JSONObject
that allows saving and restoring its values to/from the common data
80 | folder (saves/common).
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/ui/class-use/FontException.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.ui.FontException
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
Contains classes and methods for rendering text and simple GUI elements.
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
Loads a bitmap font and returns the
LazyFont
representation.
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/docs/org/lazywizard/lazylib/ui/class-use/LazyFont.LazyChar.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Class org.lazywizard.lazylib.ui.LazyFont.LazyChar
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
24 |
49 |
50 |
51 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
Contains classes and methods for rendering text and simple GUI elements.
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
Returns font metadata for a specific character.
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/docs/overview-summary.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Generated Documentation (Untitled)
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | JavaScript is disabled on your browser.
21 |
22 | index.html
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/docs/package-search-index.js:
--------------------------------------------------------------------------------
1 | packageSearchIndex = [{"l":"All Packages","u":"allpackages-index.html"},{"l":"org.lazywizard.lazylib"},{"l":"org.lazywizard.lazylib.campaign"},{"l":"org.lazywizard.lazylib.campaign.orbits"},{"l":"org.lazywizard.lazylib.combat"},{"l":"org.lazywizard.lazylib.combat.entities"},{"l":"org.lazywizard.lazylib.opengl"},{"l":"org.lazywizard.lazylib.ui"}];updateSearchResults();
--------------------------------------------------------------------------------
/docs/resources/glass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LazyWizard/lazylib/c3126153a483ea985abf97bd77cbc655e58783f3/docs/resources/glass.png
--------------------------------------------------------------------------------
/docs/resources/x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LazyWizard/lazylib/c3126153a483ea985abf97bd77cbc655e58783f3/docs/resources/x.png
--------------------------------------------------------------------------------
/docs/script-dir/jquery-ui.min.css:
--------------------------------------------------------------------------------
1 | /*! jQuery UI - v1.13.2 - 2023-02-27
2 | * http://jqueryui.com
3 | * Includes: core.css, autocomplete.css, menu.css
4 | * Copyright jQuery Foundation and other contributors; Licensed MIT */
5 |
6 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;-ms-filter:"alpha(opacity=0)"}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}
--------------------------------------------------------------------------------
/docs/serialized-form.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Serialized Form
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 | JavaScript is disabled on your browser.
22 |
23 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/docs/tag-search-index.js:
--------------------------------------------------------------------------------
1 | tagSearchIndex = [{"l":"Constant Field Values","h":"","u":"constant-values.html"},{"l":"Serialized Form","h":"","u":"serialized-form.html"}];updateSearchResults();
--------------------------------------------------------------------------------
/docs/type-search-index.js:
--------------------------------------------------------------------------------
1 | typeSearchIndex = [{"p":"org.lazywizard.lazylib.combat","l":"AIUtils"},{"l":"All Classes and Interfaces","u":"allclasses-index.html"},{"p":"org.lazywizard.lazylib.combat.entities","l":"AnchoredEntity"},{"p":"org.lazywizard.lazylib.campaign","l":"CampaignUtils"},{"p":"org.lazywizard.lazylib.campaign","l":"CargoUtils"},{"p":"org.lazywizard.lazylib","l":"CollectionUtils.CollectionFilter"},{"p":"org.lazywizard.lazylib","l":"CollectionUtils"},{"p":"org.lazywizard.lazylib","l":"CollisionUtils"},{"p":"org.lazywizard.lazylib.opengl","l":"ColorUtils"},{"p":"org.lazywizard.lazylib.combat","l":"CombatUtils"},{"p":"org.lazywizard.lazylib","l":"JSONUtils.CommonDataJSONObject"},{"p":"org.lazywizard.lazylib.combat","l":"DefenseType"},{"p":"org.lazywizard.lazylib.combat","l":"DefenseUtils"},{"p":"org.lazywizard.lazylib.ui","l":"LazyFont.DrawableString"},{"p":"org.lazywizard.lazylib.opengl","l":"DrawUtils"},{"p":"org.lazywizard.lazylib","l":"EllipseUtils"},{"p":"org.lazywizard.lazylib.campaign.orbits","l":"EllipticalOrbit"},{"p":"org.lazywizard.lazylib","l":"FastTrig"},{"p":"org.lazywizard.lazylib.ui","l":"FontException"},{"p":"org.lazywizard.lazylib.campaign","l":"CampaignUtils.IncludeRep"},{"p":"org.lazywizard.lazylib","l":"IOUtils"},{"p":"org.lazywizard.lazylib","l":"JSONUtils"},{"p":"org.lazywizard.lazylib.ui","l":"LazyFont.LazyChar"},{"p":"org.lazywizard.lazylib.ui","l":"LazyFont"},{"p":"org.lazywizard.lazylib","l":"LazyLib"},{"p":"org.lazywizard.lazylib","l":"MathUtils"},{"p":"org.lazywizard.lazylib.campaign","l":"MessageUtils"},{"p":"org.lazywizard.lazylib","l":"ModUtils"},{"p":"org.lazywizard.lazylib","l":"ShapeUtils"},{"p":"org.lazywizard.lazylib.combat.entities","l":"SimpleEntity"},{"p":"org.lazywizard.lazylib.combat.entities","l":"SimpleEntity.SimpleEntityType"},{"p":"org.lazywizard.lazylib","l":"CollectionUtils.SortEntitiesByDistance"},{"p":"org.lazywizard.lazylib","l":"CollectionUtils.SortTokensByDistance"},{"p":"org.lazywizard.lazylib","l":"StringUtils"},{"p":"org.lazywizard.lazylib.ui","l":"LazyFont.TextAlignment"},{"p":"org.lazywizard.lazylib.ui","l":"LazyFont.TextAnchor"},{"p":"org.lazywizard.lazylib","l":"VectorUtils"},{"p":"org.lazywizard.lazylib.combat","l":"WeaponUtils"}];updateSearchResults();
--------------------------------------------------------------------------------
/docstubs/org/lazywizard/lazylib/ui/FontException.java:
--------------------------------------------------------------------------------
1 | package org.lazywizard.lazylib.ui;
2 |
3 | /**
4 | * Thrown if {@link LazyFont#loadFont(String)} encounters an error loading or parsing a bitmap font.
5 | *
6 | * @author LazyWizard
7 | * @since 2.3
8 | */
9 | // Javadoc stubs for FontException, since Dokka is a steaming pile
10 | // The actual source code can be found in LazyFont.kt
11 | @SuppressWarnings("ALL")
12 | public class FontException extends Exception
13 | {
14 | public FontException(String message)
15 | {
16 | }
17 |
18 | public FontException(String message, Throwable cause)
19 | {
20 | }
21 |
22 | public FontException(Throwable cause)
23 | {
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ext/LazyLib-Extensions.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ext/src/org/lazywizard/lazylib/ext/VectorExtensions.kt:
--------------------------------------------------------------------------------
1 | package org.lazywizard.lazylib.ext
2 |
3 | import org.lazywizard.lazylib.VectorUtils
4 | import org.lwjgl.util.vector.Vector2f
5 |
6 | operator fun Vector2f.plus(other: Vector2f): Vector2f = Vector2f.add(this, other, Vector2f())
7 | operator fun Vector2f.plusAssign(other: Vector2f) { Vector2f.add(this, other, this) }
8 | operator fun Vector2f.minus(other: Vector2f): Vector2f = Vector2f.sub(this, other, Vector2f())
9 | operator fun Vector2f.minusAssign(other: Vector2f) { Vector2f.sub(this, other, this) }
10 |
11 | fun Vector2f.isZeroVector(): Boolean = VectorUtils.isZeroVector(this)
12 | fun Vector2f.getFacing(): Float = VectorUtils.getFacing(this)
13 | fun Vector2f.getAngle(to: Vector2f): Float = VectorUtils.getAngle(this, to)
14 | fun Vector2f.getDirectionalVector(destination: Vector2f): Vector2f = VectorUtils.getDirectionalVector(this, destination)
15 | fun Vector2f.getCrossProduct(other: Vector2f): Float = VectorUtils.getCrossProduct(this, other)
16 | fun Vector2f.resize(length: Float): Vector2f = VectorUtils.resize(this, length, this)
17 | fun Vector2f.clampLength(maxLength: Float): Vector2f = VectorUtils.clampLength(this, maxLength, this)
18 | fun Vector2f.clampLength(minLength: Float, maxLength: Float): Vector2f = VectorUtils.clampLength(this, minLength, maxLength, this)
19 | fun Vector2f.rotate(amount: Float): Vector2f = VectorUtils.rotate(this, amount, this)
20 | fun Vector2f.rotateAroundPivot(pivotPoint: Vector2f, amount: Float): Vector2f = VectorUtils.rotateAroundPivot(this, pivotPoint, amount, this)
21 |
--------------------------------------------------------------------------------
/ext/src/org/lazywizard/lazylib/ext/campaign/CampaignExtensions.kt:
--------------------------------------------------------------------------------
1 | package org.lazywizard.lazylib.ext.campaign
2 |
3 | import com.fs.starfarer.api.campaign.*
4 | import com.fs.starfarer.api.fleet.FleetMemberAPI
5 | import com.fs.starfarer.api.fleet.FleetMemberType
6 | import org.lazywizard.lazylib.MathUtils
7 | import org.lazywizard.lazylib.campaign.CampaignUtils
8 | import org.lazywizard.lazylib.campaign.CampaignUtils.IncludeRep
9 | import org.lwjgl.util.vector.Vector2f
10 |
11 | operator fun SectorEntityToken.contains(point: Vector2f): Boolean = MathUtils.isPointWithinCircle(point, this.location, this.radius)
12 | operator fun CampaignFleetAPI.contains(fleetMemberId: String): Boolean = CampaignUtils.isShipInFleet(fleetMemberId, this)
13 |
14 | fun CampaignFleetAPI.addShip(wingOrVariantId: String, type: FleetMemberType): FleetMemberAPI = CampaignUtils.addShipToFleet(wingOrVariantId, type, this)
15 |
16 | fun SectorEntityToken.getRelation(other: SectorEntityToken): Float = CampaignUtils.getRelation(this, other)
17 | fun SectorEntityToken.getReputation(other: SectorEntityToken): RepLevel = CampaignUtils.getReputation(this, other)
18 | fun SectorEntityToken.areAtRep(other: SectorEntityToken, include: IncludeRep, rep: RepLevel): Boolean = CampaignUtils.areAtRep(this, other, include, rep)
19 | fun SectorEntityToken.areSameFaction(other: SectorEntityToken): Boolean = CampaignUtils.areSameFaction(this, other)
20 |
21 | fun SectorEntityToken.getNearestHostileFleet(): CampaignFleetAPI? = CampaignUtils.getNearestHostileFleet(this)
22 | fun SectorEntityToken.getNearbyHostileFleets(range: Float): List = CampaignUtils.getNearbyHostileFleets(this, range)
23 | fun SectorEntityToken.getHostileFleetsInSystem(): List = CampaignUtils.getHostileFleetsInSystem(this)
24 |
25 | fun SectorEntityToken.getNearestEntityWithTag(entityTag: String): T? = CampaignUtils.getNearestEntityWithTag(this, entityTag)
26 | fun SectorEntityToken.getNearbyEntitiesWithTag(range: Float, entityTag: String): List = CampaignUtils.getNearbyEntitiesWithTag(this, range, entityTag)
27 |
28 | fun SectorEntityToken.getNearestEntityFromFaction(entityTag: String, faction: FactionAPI): T? = CampaignUtils.getNearestEntityFromFaction(this, entityTag, faction)
29 | fun SectorEntityToken.getNearbyEntitiesFromFaction(range: Float, entityTag: String, faction: FactionAPI): List = CampaignUtils.getNearbyEntitiesFromFaction(this, range, entityTag, faction)
30 | fun LocationAPI.getEntitiesFromFaction(entityTag: String, faction: FactionAPI): List = CampaignUtils.getEntitiesFromFaction(this, entityTag, faction)
31 |
32 | fun SectorEntityToken.getNearestEntityWithRep(entityTag: String, include: IncludeRep, rep: RepLevel): T? = CampaignUtils.getNearestEntityWithRep(this, entityTag, include, rep)
33 | fun SectorEntityToken.getNearbyEntitiesWithRep(range: Float, entityTag: String, include: IncludeRep, rep: RepLevel): List = CampaignUtils.getNearbyEntitiesWithRep(this, range, entityTag, include, rep)
34 | fun SectorEntityToken.getEntitiesWithRep(entityTag: String, include: IncludeRep, rep: RepLevel): List = CampaignUtils.getEntitiesWithRep(this, entityTag, include, rep)
35 |
36 | fun SectorEntityToken.getNearbyFleets(range: Float): List = CampaignUtils.getNearbyFleets(this, range)
37 |
--------------------------------------------------------------------------------
/ext/src/org/lazywizard/lazylib/ext/combat/CombatExtensions.kt:
--------------------------------------------------------------------------------
1 | package org.lazywizard.lazylib.ext.combat
2 |
3 | import com.fs.starfarer.api.combat.*
4 | import org.lazywizard.lazylib.CollisionUtils
5 | import org.lazywizard.lazylib.MathUtils
6 | import org.lazywizard.lazylib.combat.AIUtils
7 | import org.lazywizard.lazylib.combat.CombatUtils
8 | import org.lwjgl.util.vector.Vector2f
9 |
10 | operator fun BoundsAPI.SegmentAPI.contains(point: Vector2f): Boolean = MathUtils.isPointOnLine(point, this.p1, this.p2)
11 | operator fun CombatEntityAPI.contains(point: Vector2f): Boolean = CollisionUtils.isPointWithinBounds(point, this)
12 | operator fun ShieldAPI.contains(point: Vector2f): Boolean = this.isWithinArc(point)
13 |
14 | fun CombatEntityAPI.getNearestPointOnBounds(source: Vector2f): Vector2f = CollisionUtils.getNearestPointOnBounds(source, this)
15 | fun CombatEntityAPI.getCollisionPoint(lineStart: Vector2f, lineEnd: Vector2f): Vector2f? = CollisionUtils.getCollisionPoint(lineStart, lineEnd, this)
16 |
17 | fun CombatEntityAPI.getNearestObjective(): BattleObjectiveAPI? = AIUtils.getNearestObjective(this)
18 | fun CombatEntityAPI.getNearbyObjectives(range: Float): List = CombatUtils.getObjectivesWithinRange(this.location, range)
19 |
20 | fun CombatEntityAPI.getNearestShip(): ShipAPI? = AIUtils.getNearestShip(this)
21 | fun CombatEntityAPI.getNearbyShips(range: Float): List = CombatUtils.getShipsWithinRange(this.location, range)
22 |
23 | fun CombatEntityAPI.getNearestMissile(): MissileAPI? = AIUtils.getNearestMissile(this)
24 | fun CombatEntityAPI.getNearbyMissiles(range: Float): List = CombatUtils.getMissilesWithinRange(this.location, range)
25 |
26 | fun CombatEntityAPI.getNearestAlly(): ShipAPI? = AIUtils.getNearestAlly(this)
27 | fun CombatEntityAPI.getNearbyAllies(range: Float): List = AIUtils.getNearbyAllies(this, range)
28 | fun CombatEntityAPI.getAlliesOnMap(): List = AIUtils.getAlliesOnMap(this)
29 |
30 | fun CombatEntityAPI.getNearestEnemyMissile(): MissileAPI? = AIUtils.getNearestEnemyMissile(this)
31 | fun CombatEntityAPI.getNearbyEnemyMissiles(range: Float): List = AIUtils.getNearbyEnemyMissiles(this, range)
32 | fun CombatEntityAPI.getEnemyMissilesOnMap(): List = AIUtils.getEnemyMissilesOnMap(this)
33 |
34 | fun CombatEntityAPI.getNearestEnemy(): ShipAPI? = AIUtils.getNearestEnemy(this)
35 | fun CombatEntityAPI.getNearbyEnemies(range: Float): List = AIUtils.getNearbyEnemies(this, range)
36 | fun CombatEntityAPI.getEnemiesOnMap(): List = AIUtils.getEnemiesOnMap(this)
37 |
38 | fun ShipAPI.canUseSystemThisFrame(): Boolean = AIUtils.canUseSystemThisFrame(this)
39 | fun ShipAPI.isVisibleToSide(side: Int): Boolean = CombatUtils.isVisibleToSide(this, side)
40 |
41 | fun CombatEntityAPI.applyForce(direction: Vector2f, force: Float) = CombatUtils.applyForce(this, direction, force)
42 | fun CombatEntityAPI.applyForce(direction: Float, force: Float) = CombatUtils.applyForce(this, direction, force)
43 |
--------------------------------------------------------------------------------
/ext/src/org/lazywizard/lazylib/ext/json/JSONExtensions.kt:
--------------------------------------------------------------------------------
1 | package org.lazywizard.lazylib.ext.json
2 |
3 | import com.fs.starfarer.api.SettingsAPI
4 | import org.json.JSONArray
5 | import org.json.JSONObject
6 |
7 | fun SettingsAPI.loadCoreCsv(id: String, path: String): JSONArray = this.getMergedSpreadsheetDataForMod(id, path, "starsector-core")
8 |
9 | fun JSONObject.getFloat(key: String): Float = this.getDouble(key).toFloat()
10 | fun JSONObject.optFloat(key: String): Float = this.optDouble(key).toFloat()
11 | fun JSONObject.optFloat(key: String, defaultValue: Float): Float = this.optDouble(key, defaultValue.toDouble()).toFloat()
12 |
13 | fun JSONArray.getFloat(index: Int): Float = this.getDouble(index).toFloat()
14 | fun JSONArray.optFloat(index: Int): Float = this.optDouble(index).toFloat()
15 | fun JSONArray.optFloat(index: Int, defaultValue: Float): Float = this.optDouble(index, defaultValue.toDouble()).toFloat()
16 |
17 | operator fun JSONArray.iterator(): Iterator = JSONIterator(this)
18 |
19 | private class JSONIterator(val src: JSONArray) : Iterator {
20 | var index = 0
21 |
22 | override fun next(): JSONObject {
23 | index++
24 | return src.getJSONObject(index - 1)
25 | }
26 |
27 | override fun hasNext(): Boolean = (index < src.length())
28 | }
29 |
--------------------------------------------------------------------------------
/ext/src/org/lazywizard/lazylib/ext/logging/LogExtensions.kt:
--------------------------------------------------------------------------------
1 | package org.lazywizard.lazylib.ext.logging
2 |
3 | import org.apache.log4j.Level
4 | import org.apache.log4j.Logger
5 |
6 | inline fun Logger.i(message: () -> String, ex: Throwable? = null) {
7 | if (isEnabledFor(Level.INFO)) info(message.invoke(), ex)
8 | }
9 |
10 | inline fun Logger.d(message: () -> String, ex: Throwable? = null) {
11 | if (isEnabledFor(Level.DEBUG)) debug(message.invoke(), ex)
12 | }
13 |
14 | inline fun Logger.w(message: () -> String, ex: Throwable? = null) {
15 | if (isEnabledFor(Level.WARN)) warn(message.invoke(), ex)
16 | }
17 |
18 | inline fun Logger.e(message: () -> String, ex: Throwable? = null) {
19 | if (isEnabledFor(Level.ERROR)) error(message.invoke(), ex)
20 | }
21 |
22 | inline fun Logger.f(message: () -> String, ex: Throwable? = null) {
23 | if (isEnabledFor(Level.FATAL)) fatal(message.invoke(), ex)
24 | }
25 |
--------------------------------------------------------------------------------
/mod/data/config/version/version_files.csv:
--------------------------------------------------------------------------------
1 | version file
2 | lazylib.version
--------------------------------------------------------------------------------
/mod/jars/readme.txt:
--------------------------------------------------------------------------------
1 | LazyLib.jar: contains the main libraries. This is the only dependency most
2 | modders will need from this library.
3 |
4 | LazyLib-Kotlin.jar: contains Kotlin extension methods for LazyLib methods,
5 | as well as the kotlinx.coroutines library. Include this as a dependency if
6 | your mod is written using Kotlin. Otherwise, it can safely be ignored.
7 |
8 | The internal folder contains the Kotlin runtime and functionality only used
9 | by LazyLib itself such as tests. Modders shouldn't need to touch these files.
--------------------------------------------------------------------------------
/mod/lazylib.version:
--------------------------------------------------------------------------------
1 | {
2 | "changelogURL":"https://raw.githubusercontent.com/LazyWizard/lazylib/master/mod/changelog.txt",
3 | "masterVersionFile":"https://raw.githubusercontent.com/LazyWizard/lazylib/master/mod/lazylib.version",
4 | "modName":"LazyLib",
5 | "modNexusId":1,
6 | "modThreadId":5444,
7 | "modVersion":
8 | {
9 | "major":3,
10 | "minor":0,
11 | "patch":0
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/mod/lazylib_settings.json:
--------------------------------------------------------------------------------
1 | {
2 | # Whether to cache expensive methods whose results won't change this frame
3 | # This should be left on unless a bug is discovered in the cache system
4 | "enableCaching":true,
5 |
6 | # You can ignore this setting, it's only used to control internal LazyLib
7 | # debugging. logDeprecated (below) is not affected by this setting
8 | # Valid levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL
9 | "logLevel":"WARN",
10 |
11 | # Whether to log usage of deprecated LazyLib methods (for modders)
12 | # The logged output will include the class and line number of the caller
13 | # Deprecated methods will be removed eventually, so this is very useful
14 | # Note: this setting can have an impact on performance, don't leave it on!
15 | "logDeprecated":false,
16 |
17 | # Whether to crash the game when a deprecated LazyLib method is used
18 | # This is here so modders can follow the full trace of the code calling it
19 | "crashOnDeprecated":false,
20 | }
21 |
--------------------------------------------------------------------------------
/mod/license.txt:
--------------------------------------------------------------------------------
1 | All modders have my permission to copy and use any code I've written.
2 |
3 | ================================================================================
4 |
5 | Parts of the FastTrig class used in this mod are taken from the Slick2D library.
6 |
7 | Copyright (c) 2007, Slick 2D
8 | All rights reserved.
9 | Redistribution and use in source and binary forms, with or without modification,
10 | are permitted provided that the following conditions are met:
11 |
12 | * Redistributions of source code must retain the above copyright notice, this
13 | list of conditions and the following disclaimer.
14 | * Redistributions in binary form must reproduce the above copyright notice,
15 | this list of conditions and the following disclaimer in the documentation
16 | and/or other materials provided with the distribution.
17 | * Neither the name of the Slick 2D nor the names of its contributors may be
18 | used to endorse or promote products derived from this software without
19 | specific prior written permission.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 | POSSIBILITY OF SUCH DAMAGE.
32 |
33 | ================================================================================
34 |
35 | Kotlin and the Kotlin runtime are copyright 2010-2017 JetBrains s.r.o.
36 |
37 | Licensed under the Apache License, Version 2.0 (the "License");
38 | you may not use this file except in compliance with the License.
39 | You may obtain a copy of the License at
40 |
41 | http://www.apache.org/licenses/LICENSE-2.0
42 |
43 | Unless required by applicable law or agreed to in writing, software
44 | distributed under the License is distributed on an "AS IS" BASIS,
45 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
46 | See the License for the specific language governing permissions and
47 | limitations under the License.
48 |
--------------------------------------------------------------------------------
/mod/mod_info.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "lw_lazylib", #// If changed, also update MOD_ID in org.lazywizard.lazylib.LazyLib
3 | "name": "LazyLib",
4 | "author": "LazyWizard",
5 | "utility": "true",
6 | "version":
7 | {
8 | "major":3,
9 | "minor":0,
10 | "patch":0 #// Should always be 0 or a letter, not a non-zero digit
11 | },
12 | "description": "A collection of classes to aid modding. Not a mod in itself, but required by certain other mods.",
13 | "gameVersion": "0.98a-RC5",
14 | "jars": ["jars/LazyLib.jar","jars/LazyLib-Kotlin.jar","jars/internal/LazyLib-Console.jar","jars/internal/Kotlin-Runtime.jar"],
15 | "modPlugin": "org.lazywizard.lazylib.LazyLib"
16 | }
17 |
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/IOUtils.java:
--------------------------------------------------------------------------------
1 | package org.lazywizard.lazylib;
2 |
3 | import com.fs.starfarer.api.Global;
4 |
5 | import java.io.IOException;
6 | import java.io.InputStream;
7 | import java.nio.file.Path;
8 | import java.util.Arrays;
9 |
10 | /**
11 | * Contains classes for reading and writing files within the game's classloader restrictions.
12 | *
13 | * @author LazyWizard
14 | * @since 2.6
15 | */
16 | public class IOUtils
17 | {
18 | private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8;
19 | private static final int BUFFER_SIZE = 8192;
20 |
21 | /**
22 | * This is a port of {@link java.nio.file.Files#readAllBytes(Path)}
23 | * that has been modified to work within the game's classloader restrictions.
24 | *
25 | * @param filePath The local file path of the file to read.
26 | *
27 | * @return The contents of the file at {@code filePath} as a byte array.
28 | *
29 | * @since 2.6
30 | */
31 | public static byte[] readAllBytes(String filePath) throws IOException
32 | {
33 | try (final InputStream source = Global.getSettings().openStream(filePath))
34 | {
35 | int capacity = source.available();
36 | byte[] buf = new byte[capacity];
37 | int nread = 0;
38 | int n;
39 | while (true)
40 | {
41 | // read to EOF which may read more or less than initialSize (eg: file
42 | // is truncated while we are reading)
43 | while ((n = source.read(buf, nread, capacity - nread)) > 0)
44 | {
45 | nread += n;
46 | }
47 |
48 | // if last call to source.read() returned -1, we are done
49 | // otherwise, try to read one more byte; if that failed we're done too
50 | if (n < 0 || (n = source.read()) < 0)
51 | {
52 | break;
53 | }
54 |
55 | // one more byte was read; need to allocate a larger buffer
56 | if (capacity <= MAX_BUFFER_SIZE - capacity)
57 | {
58 | capacity = Math.max(capacity << 1, BUFFER_SIZE);
59 | }
60 | else
61 | {
62 | if (capacity == MAX_BUFFER_SIZE)
63 | {
64 | throw new OutOfMemoryError("Required array size too large");
65 | }
66 | capacity = MAX_BUFFER_SIZE;
67 | }
68 | buf = Arrays.copyOf(buf, capacity);
69 | buf[nread++] = (byte) n;
70 | }
71 |
72 | return (capacity == nread) ? buf : Arrays.copyOf(buf, nread);
73 | }
74 | }
75 |
76 | private IOUtils()
77 | {
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/campaign/MessageUtils.java:
--------------------------------------------------------------------------------
1 | package org.lazywizard.lazylib.campaign;
2 |
3 | import com.fs.starfarer.api.Global;
4 | import org.jetbrains.annotations.Nullable;
5 | import org.lazywizard.lazylib.StringUtils;
6 |
7 | /**
8 | * Allows formatted, multi-line, word-wrapped sector messages
9 | *
10 | * @author LazyWizard
11 | * @since 1.0
12 | */
13 | public class MessageUtils
14 | {
15 | /**
16 | * How long a line can be before being split by
17 | * {@link MessageUtils#showMessage(java.lang.String)}. This is hardcoded to
18 | * a number that still looks good at very low resolutions. If you wish to
19 | * have a different message length, you can use {@link
20 | * StringUtils#wrapString(java.lang.String, int)} then output the results.
21 | */
22 | public static final int LINE_LENGTH = 80;
23 |
24 | /**
25 | * Formats and word-wraps the supplied text, then outputs it as a sector
26 | * message.
27 | *
28 | * @param preamble The header for this message, won't be indented. Can be null.
29 | * @param message The main body of text.
30 | * @param indentMessage Whether to indent each line of the main body.
31 | *
32 | * @since 1.0
33 | */
34 | public static void showMessage(@Nullable String preamble,
35 | String message, boolean indentMessage)
36 | {
37 | if (preamble != null)
38 | {
39 | for (String tmp : StringUtils.wrapString(preamble, LINE_LENGTH).split("\n"))
40 | {
41 | Global.getSector().getCampaignUI().addMessage(tmp);
42 | }
43 | }
44 |
45 | if (message != null)
46 | {
47 | for (String tmp : StringUtils.wrapString(message, LINE_LENGTH).split("\n"))
48 | {
49 | if (indentMessage)
50 | {
51 | Global.getSector().getCampaignUI().addMessage(" " + tmp);
52 | }
53 | else
54 | {
55 | Global.getSector().getCampaignUI().addMessage(tmp);
56 | }
57 | }
58 | }
59 | }
60 |
61 | /**
62 | * Formats and word-wraps the supplied text, then outputs it as a sector
63 | * message.
64 | *
65 | * @param message The message to output.
66 | *
67 | * @since 1.0
68 | */
69 | public static void showMessage(String message)
70 | {
71 | showMessage(null, message, false);
72 | }
73 |
74 | private MessageUtils()
75 | {
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/campaign/orbits/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains implementations of {@link com.fs.starfarer.api.campaign.OrbitAPI}.
3 | */
4 | package org.lazywizard.lazylib.campaign.orbits;
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/campaign/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains campaign helper classes.
3 | */
4 | package org.lazywizard.lazylib.campaign;
5 |
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/combat/CombatCache.java:
--------------------------------------------------------------------------------
1 | package org.lazywizard.lazylib.combat;
2 |
3 | import com.fs.starfarer.api.Global;
4 | import com.fs.starfarer.api.combat.ShipAPI;
5 |
6 | import java.util.*;
7 |
8 | class CombatCache
9 | {
10 | private static final Map> visCache = new HashMap<>();
11 | private static int lastNumShips = 0;
12 | private static float lastTime = 0f;
13 |
14 | static
15 | {
16 | // If support for more than two sides is ever added, just
17 | // add the side's owner number to this list
18 | visCache.put(0, Collections.newSetFromMap(
19 | new WeakHashMap()));
20 | visCache.put(1, Collections.newSetFromMap(
21 | new WeakHashMap()));
22 | }
23 |
24 | static List getCachedVisibleEnemies(int side)
25 | {
26 | if (!visCache.containsKey(side))
27 | {
28 | return Collections.emptyList();
29 | }
30 |
31 | final int numShips = Global.getCombatEngine().getShips().size();
32 | final float time = Global.getCombatEngine().getTotalElapsedTime(true);
33 | if ((numShips != lastNumShips) || (time != lastTime))
34 | {
35 | cacheMapVisible();
36 | lastNumShips = numShips;
37 | lastTime = time;
38 | }
39 |
40 | return new ArrayList<>(visCache.get(side));
41 | }
42 |
43 | private static void cacheMapVisible()
44 | {
45 | for (Map.Entry> entry : visCache.entrySet())
46 | {
47 | final int owner = entry.getKey();
48 | final Set visible = entry.getValue();
49 | visible.clear();
50 | for (ShipAPI tmp : Global.getCombatEngine().getShips())
51 | {
52 | if (tmp.getOwner() != owner && !tmp.isHulk() && !tmp.isShuttlePod()
53 | && CombatUtils.isVisibleToSide(tmp, owner))
54 | {
55 | visible.add(tmp);
56 | }
57 | }
58 | }
59 | }
60 |
61 | private CombatCache()
62 | {
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/combat/DefenseType.java:
--------------------------------------------------------------------------------
1 | package org.lazywizard.lazylib.combat;
2 |
3 | public enum DefenseType
4 | {
5 | HULL,
6 | ARMOR,
7 | SHIELD,
8 | PHASE_OR_MISS
9 | }
10 |
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/combat/entities/AnchoredEntity.java:
--------------------------------------------------------------------------------
1 | package org.lazywizard.lazylib.combat.entities;
2 |
3 | import com.fs.starfarer.api.combat.CombatEntityAPI;
4 | import org.lazywizard.lazylib.MathUtils;
5 | import org.lazywizard.lazylib.VectorUtils;
6 | import org.lwjgl.util.vector.Vector2f;
7 |
8 | /**
9 | * An implementation of {@link CombatEntityAPI} that follows and rotates
10 | * with another anchoring {@link CombatEntityAPI}.
11 | *
12 | * @author LazyWizard
13 | * @since 1.5
14 | */
15 | public class AnchoredEntity extends EntityBase
16 | {
17 | protected CombatEntityAPI anchor;
18 | protected float relativeDistance, relativeAngle;
19 |
20 | /**
21 | * Creates a {@code CombatEntityAPI} that follows and rotates with another
22 | * anchoring {@code CombatEntityAPI}.
23 | *
24 | * @param anchor The {@link CombatEntityAPI} to follow and rotate with.
25 | * @param location The location relative to {@code anchor} to track.
26 | *
27 | * @since 1.5
28 | */
29 | public AnchoredEntity(CombatEntityAPI anchor, Vector2f location)
30 | {
31 | reanchor(anchor, location);
32 | }
33 |
34 | /**
35 | * Reorient this entity around a new anchor.
36 | *
37 | * @param newAnchor The {@link CombatEntityAPI} to follow and rotate with.
38 | * @param newLocation The location relative to {@code anchor} to track.
39 | *
40 | * @since 1.8
41 | */
42 | public void reanchor(CombatEntityAPI newAnchor, Vector2f newLocation)
43 | {
44 | relativeDistance = MathUtils.getDistance(newAnchor.getLocation(), newLocation);
45 | relativeAngle = MathUtils.clampAngle(VectorUtils.getAngle(
46 | newAnchor.getLocation(), newLocation) - newAnchor.getFacing());
47 | anchor = newAnchor;
48 | }
49 |
50 | /**
51 | * Returns the location of this entity, calculated to be relative to
52 | * its anchor.
53 | *
54 | * @return The location of this entity.
55 | *
56 | * @since 1.5
57 | */
58 | @Override
59 | public Vector2f getLocation()
60 | {
61 | if (relativeDistance == 0f)
62 | {
63 | return new Vector2f(anchor.getLocation());
64 | }
65 |
66 | return MathUtils.getPointOnCircumference(anchor.getLocation(),
67 | relativeDistance, relativeAngle + anchor.getFacing());
68 | }
69 |
70 | /**
71 | * Returns the velocity of this entity's anchor (and by definition this entity's velocity as well).
72 | *
73 | * @return The velocity of this entity's anchor (a direct reference, so changes will propagate!).
74 | *
75 | * @since 1.5
76 | */
77 | @Override
78 | public Vector2f getVelocity()
79 | {
80 | return anchor.getVelocity();
81 | }
82 |
83 | /**
84 | * Returns the {@link CombatEntityAPI} this entity is anchored to.
85 | *
86 | * @return The {@link CombatEntityAPI} this entity is anchored to.
87 | *
88 | * @since 1.5
89 | */
90 | public CombatEntityAPI getAnchor()
91 | {
92 | return anchor;
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/combat/entities/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains instantiable combat entities.
3 | */
4 | package org.lazywizard.lazylib.combat.entities;
5 |
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/combat/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains combat helper classes.
3 | */
4 | package org.lazywizard.lazylib.combat;
5 |
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/opengl/ColorUtils.java:
--------------------------------------------------------------------------------
1 | package org.lazywizard.lazylib.opengl;
2 |
3 | import org.lazywizard.lazylib.MathUtils;
4 |
5 | import java.awt.Color;
6 |
7 | import static org.lwjgl.opengl.GL11.glColor4ub;
8 |
9 | /**
10 | * Contains methods for working with OpenGL and AWT color objects.
11 | *
12 | * @author LazyWizard
13 | * @since 1.9
14 | */
15 | public class ColorUtils
16 | {
17 | /**
18 | * Sets the OpenGL color using an AWT {@link Color} object.
19 | *
20 | * @param color The color to set.
21 | * @param alphaMult Multiplies the color's alpha channel with
22 | * this, or replaces it if
23 | * {@code overrideOriginalAlpha} is
24 | * {@code true}.
25 | * @param overrideOriginalAlpha Whether to completely override
26 | * {@code color}'s alpha channel with
27 | * {@code alphaMult}.
28 | *
29 | * @since 1.9
30 | */
31 | public static void glColor(Color color, float alphaMult, boolean overrideOriginalAlpha)
32 | {
33 | glColor4ub((byte) color.getRed(), (byte) color.getGreen(),
34 | (byte) color.getBlue(), (byte) MathUtils.clamp((int) (overrideOriginalAlpha
35 | ? alphaMult * 255f : (color.getAlpha() * alphaMult)), 0, 255));
36 | }
37 |
38 | /**
39 | * Sets the OpenGL color using an AWT {@link Color} object.
40 | *
41 | * @param color The color to set.
42 | * @param alpha The color's opacity, from 0 to 1.
43 | *
44 | * @since 2.3
45 | */
46 | public static void glColor(Color color, float alpha)
47 | {
48 | glColor(color, alpha, true);
49 | }
50 |
51 | /**
52 | * Sets the OpenGL color using an AWT {@link Color} object.
53 | *
54 | * @param color The color to set.
55 | *
56 | * @since 1.9
57 | */
58 | public static void glColor(Color color)
59 | {
60 | glColor4ub((byte) color.getRed(), (byte) color.getGreen(),
61 | (byte) color.getBlue(), (byte) color.getAlpha());
62 | }
63 |
64 | /**
65 | * Generates a {@link Color} with randomized RGB components.
66 | *
67 | * @return A {@link Color} whose RGB components are all randomized. Alpha will be at 100%.
68 | *
69 | * @since 3.0
70 | */
71 | public static Color genRandomColor()
72 | {
73 | return new Color(MathUtils.getRandomNumberInRange(0, 0xff000000));
74 | }
75 |
76 | private ColorUtils()
77 | {
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/opengl/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains classes to help with drawing OpenGL primitives.
3 | */
4 | package org.lazywizard.lazylib.opengl;
5 |
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains general methods that mostly help with non-API data types.
3 | */
4 | package org.lazywizard.lazylib;
5 |
--------------------------------------------------------------------------------
/src/org/lazywizard/lazylib/ui/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains classes and methods for rendering text and simple GUI elements.
3 | */
4 | package org.lazywizard.lazylib.ui;
5 |
--------------------------------------------------------------------------------
/tests/.gitignore:
--------------------------------------------------------------------------------
1 | standalone/
--------------------------------------------------------------------------------
/tests/LazyLib-Tests.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/tests/unit/ColorUtilsTests.java:
--------------------------------------------------------------------------------
1 | import org.junit.Test;
2 | import org.lazywizard.lazylib.MathUtils;
3 |
4 | import java.awt.Color;
5 |
6 | import static org.junit.Assert.assertEquals;
7 | import static org.junit.Assert.assertTrue;
8 |
9 | public class ColorUtilsTests
10 | {
11 | private static final int NUM_TESTS = 1_200_000;
12 |
13 | @Test
14 | public void testGenRandomColor()
15 | {
16 | int totalRed = 0, totalGreen = 0, totalBlue = 0, totalAlpha = 0;
17 | final float[] colComponents = new float[4];
18 | for (int i = 0; i < NUM_TESTS; i++)
19 | {
20 | final Color color = new Color(MathUtils.getRandomNumberInRange(0, 0xff000000));
21 | for (float component : color.getRGBColorComponents(colComponents))
22 | {
23 | assertTrue(component >= 0f && component <= 1f);
24 | }
25 |
26 | totalRed += color.getRed();
27 | totalGreen += color.getGreen();
28 | totalBlue += color.getBlue();
29 | totalAlpha += color.getAlpha();
30 | }
31 |
32 | // Ensure equal distribution of colors
33 | assertEquals(totalRed / NUM_TESTS, 127);
34 | assertEquals(totalGreen / NUM_TESTS, 127);
35 | assertEquals(totalBlue / NUM_TESTS, 127);
36 | assertEquals(totalAlpha / NUM_TESTS, 255);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/tests/unit/FastTrigTests.java:
--------------------------------------------------------------------------------
1 | import org.junit.Test;
2 | import org.lazywizard.lazylib.FastTrig;
3 | import org.lazywizard.lazylib.MathUtils;
4 |
5 | import static org.junit.Assert.assertEquals;
6 |
7 | public class FastTrigTests
8 | {
9 | private static final int NUM_TESTS = 2_000_000;
10 |
11 | @Test
12 | public void testFastTrig()
13 | {
14 | for (int i = 1; i <= NUM_TESTS; i++)
15 | {
16 | final double rand = MathUtils.getRandomNumberInRange(-1000f, 1000f),
17 | rand2 = MathUtils.getRandomNumberInRange(-1000f, 1000f);
18 | assertEquals("Test " + i + " failed: sin(" + rand + ")",
19 | Math.sin(rand), FastTrig.sin(rand), 0.005f);
20 | assertEquals("Test " + i + " failed: cos(" + rand + ")",
21 | Math.cos(rand), FastTrig.cos(rand), 0.005f);
22 | assertEquals("Test " + i + " failed: atan(" + rand + ")",
23 | Math.atan(rand), FastTrig.atan(rand), 0.005f);
24 | assertEquals("Test " + i + " failed: atan2(" + rand + ", " + rand2 + ")",
25 | Math.atan2(rand, rand2), FastTrig.atan2(rand, rand2), 0.05f);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/tests/unit/ModUtilsTests.java:
--------------------------------------------------------------------------------
1 | import org.junit.Test;
2 |
3 | import java.text.NumberFormat;
4 |
5 | public class ModUtilsTests
6 | {
7 | /* private static final int NUM_TESTS = 150_000;
8 |
9 | @Test
10 | public void testGetCallerClass()
11 | {
12 | final NumberFormat format = NumberFormat.getNumberInstance();
13 | System.out.println("Running " + format.format(NUM_TESTS) + " tests...");
14 | long startTime = System.nanoTime();
15 | for (int i = 0; i < NUM_TESTS; i++)
16 | {
17 | final Class tmp = sun.reflect.Reflection.getCallerClass(2);
18 | }
19 |
20 | final double dur1 = (System.nanoTime() - startTime) / 1_000_000_000.0;
21 | System.out.println("Duration (getCallerClass()): " + format.format(dur1) + " seconds \t(" +
22 | (dur1 / NUM_TESTS) + " per)");
23 |
24 | startTime = System.nanoTime();
25 | for (int i = 0; i < NUM_TESTS; i++)
26 | {
27 | final String tmp = Thread.currentThread().getStackTrace()[2].getClassName();
28 | }
29 |
30 | final double dur2 = (System.nanoTime() - startTime) / 1_000_000_000.0;
31 | System.out.println("Duration (getStackTrace()): " + format.format(dur2) + " seconds \t(" +
32 | (dur2 / NUM_TESTS) + " per)");
33 | }
34 |
35 | public static void main(String[] args)
36 | {
37 | new ModUtilsTests().testGetCallerClass();
38 | }*/
39 | }
40 |
--------------------------------------------------------------------------------
/tests/unit/ShapeUtilsTests.java:
--------------------------------------------------------------------------------
1 | public class ShapeUtilsTests
2 | {
3 | private static final int NUM_TESTS = 100_000;
4 | }
--------------------------------------------------------------------------------
/tests/unit/VectorUtilsTests.java:
--------------------------------------------------------------------------------
1 | import org.junit.Test;
2 | import org.lazywizard.lazylib.MathUtils;
3 | import org.lazywizard.lazylib.ShapeUtils;
4 | import org.lwjgl.util.vector.Vector2f;
5 |
6 | import java.util.List;
7 |
8 | import static org.junit.Assert.assertArrayEquals;
9 | import static org.junit.Assert.assertEquals;
10 | import static org.lazywizard.lazylib.VectorUtils.toFloatArray;
11 | import static org.lazywizard.lazylib.VectorUtils.toVectorList;
12 |
13 | public class VectorUtilsTests
14 | {
15 | private static final int NUM_TESTS = 1_200_000;
16 |
17 | @Test
18 | public void testGetFacing()
19 | {
20 |
21 | }
22 |
23 | @Test
24 | public void testGetAngle()
25 | {
26 |
27 | }
28 |
29 | @Test
30 | public void testGetDirectionalVector()
31 | {
32 |
33 | }
34 |
35 | @Test
36 | public void testGetCrossProduct()
37 | {
38 |
39 | }
40 |
41 | @Test
42 | public void testResize()
43 | {
44 |
45 | }
46 |
47 | @Test
48 | public void testClampLength()
49 | {
50 |
51 | }
52 |
53 | @Test
54 | public void testRotate()
55 | {
56 | // Also include rotateAroundPivot()
57 | }
58 |
59 | @Test
60 | public void testToVectorList()
61 | {
62 | for (int i = 1; i <= NUM_TESTS; i++)
63 | {
64 | final float[] asArray = ShapeUtils.createCircle(MathUtils.getRandomNumberInRange(-5000, 5000),
65 | MathUtils.getRandomNumberInRange(-5000, 5000),
66 | MathUtils.getRandomNumberInRange(500, 5000),
67 | MathUtils.getRandomNumberInRange(10, 1000));
68 | final List asList = toVectorList(asArray);
69 | assertEquals(asList.size(), asArray.length / 2);
70 | for (int j = 0; j < asList.size(); j++)
71 | {
72 | final Vector2f vector = asList.get(j);
73 | assertEquals("Test " + i + " failed on x coordinate: ",
74 | asArray[j * 2], vector.x, 0f);
75 | assertEquals("Test " + i + " failed on y coordinate: ",
76 | asArray[j * 2 + 1], vector.y, 0f);
77 | }
78 | }
79 | }
80 |
81 | @Test
82 | public void testToFloatArray()
83 | {
84 | for (int i = 1; i <= NUM_TESTS; i++)
85 | {
86 | final float[] asArray = ShapeUtils.createCircle(MathUtils.getRandomNumberInRange(-5000, 5000),
87 | MathUtils.getRandomNumberInRange(-5000, 5000),
88 | MathUtils.getRandomNumberInRange(500, 5000),
89 | MathUtils.getRandomNumberInRange(10, 1000));
90 | final List asList = toVectorList(asArray);
91 | assertArrayEquals("Reconverted array does not match original",
92 | asArray, toFloatArray(asList), 0f);
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------