Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathStaticBuilding.java
More file actions
Latest commit
51 lines (43 loc) · 1.62 KB
/
Copy pathStaticBuilding.java
File metadata and controls
51 lines (43 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Original work Copyright (c) 2015, 2017, Igor Dimitrijevic
// Modified work Copyright (c) 2017-2018 OpenBW Team
//////////////////////////////////////////////////////////////////////////
//
// This file is part of the BWEM Library.
// BWEM is free software, licensed under the MIT/X11 License.
// A copy of the license is provided with the library in the LICENSE file.
// Copyright (c) 2015, 2017, Igor Dimitrijevic
//
//////////////////////////////////////////////////////////////////////////
packagebwem;
importbwapi.TilePosition;
importbwapi.Unit;
importstaticbwapi.UnitType.Special_Right_Pit_Door;
/**
* StaticBuildings Correspond to the units in BWAPI::getStaticNeutralUnits() for which
* getType().isSpecialBuilding. StaticBuilding also wrappers some special units like
* Special_Pit_Door.
*/
publicclassStaticBuildingextendsNeutral {
StaticBuilding(finalUnitunit, finalBWMapmap) {
super(unit, map);
// https://github.com/N00byEdge/BWEM-community/blob/cf377c14a6fbad91d6bb4ce6c232a77cb22b500c/BWEM/src/neutral.cpp#L36
if (unit.getType() == Special_Right_Pit_Door) {
topLeft = topLeft.add(newTilePosition(1, 0));
}
}
@Override
publicbooleanequals(finalObjectobject) {
if (this == object) {
returntrue;
} elseif (!(objectinstanceofStaticBuilding)) {
returnfalse;
} else {
finalStaticBuildingthat = (StaticBuilding) object;
return (this.getUnit().getID() == that.getUnit().getID());
}
}
@Override
publicinthashCode() {
returngetUnit().hashCode();
}
}