Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity debug helper #4971

Merged
merged 1 commit into from
Dec 21, 2023
Merged

Entity debug helper #4971

merged 1 commit into from
Dec 21, 2023

Conversation

SJuliez
Copy link
Member

@SJuliez SJuliez commented Dec 20, 2023

This adds a debugging helper class to get an overview of the equipment. It lists the equipment and critical slots with almost all the internal state of each (all for CriticalSlot, not quite all for Mounted - there is not much to see in the examples, as these are fresh units but damage and other state is shown when appropriate). For me, the intention is to help with debugging in MML where sometimes equipment gets left in a state that seems not quite right but is very tedious to find in the debugger. I think this also helps with seeing the linked/linkedBy/crosslinked things better. Appropriate toString methods in Mounted and CriticalSlot have been added.

The result is e.g.:

Chassis: >Albatross<
Model: >ALB-5U<
Equipment:
[0] Standard () {  }
[1] ISRotaryAC2 (LA) { Linked: [9] }
[2] IS Heavy Ferro-Fibrous (CT/RT/LT/RA/LA) {  }
[3] ISLargeXPulseLaser (RA) {  }
[4] ISERMediumLaser (RA) {  }
[5] ISERMediumLaser (RA) {  }
[6] ISERSmallLaser (LT) {  }
[7] IS Ammo MML-7 SRM (LT) { LinkedBy: [11], Shots: 14 }
[8] IS Ammo MML-7 LRM (LT) { Shots: 17 }
[9] ISRotaryAC2 Ammo (LT) { LinkedBy: [1], Shots: 45 }
[10] ISCASE (LT) {  }
[11] ISMML7 (RT) { Linked: [7] }
[12] ISDoubleHeatSink () {  }
[13] ISDoubleHeatSink () {  }
[14] ISDoubleHeatSink () {  }
[15] ISDoubleHeatSink () {  }
[16] ISDoubleHeatSink () {  }
[17] ISDoubleHeatSink () {  }
[18] ISDoubleHeatSink () {  }
[19] ISDoubleHeatSink () {  }
[20] ISDoubleHeatSink () {  }
[21] ISDoubleHeatSink () {  }
[22] ISDoubleHeatSink () {  }
[23] ISDoubleHeatSink () {  }
[24] ISDoubleHeatSink () {  }

Locations:
HD:
[0] System Slot { System No: 0 } (Life Support)
[1] System Slot { System No: 1 } (Sensors)
[2] System Slot { System No: 2 } (Standard Cockpit)
[4] System Slot { System No: 1 } (Sensors)
[5] System Slot { System No: 0 } (Life Support)
CT:
[0] System Slot { System No: 3 } (Engine)
[1] System Slot { System No: 3 } (Engine)
[2] System Slot { System No: 3 } (Engine)
[3] System Slot { System No: 4 } (Heavy Duty Gyro)
[4] System Slot { System No: 4 } (Heavy Duty Gyro)
[5] System Slot { System No: 4 } (Heavy Duty Gyro)
[6] System Slot { System No: 4 } (Heavy Duty Gyro)
[7] System Slot { System No: 3 } (Engine)
[8] System Slot { System No: 3 } (Engine)
[9] System Slot { System No: 3 } (Engine)
[10] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
RT:
[0] System Slot { System No: 3 } (Engine)
[1] System Slot { System No: 3 } (Engine)
[2] Equipment Slot { [11] ISMML7 }
[3] Equipment Slot { [11] ISMML7 }
[4] Equipment Slot { [11] ISMML7 }
[5] Equipment Slot { [11] ISMML7 }
[6] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[7] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[8] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[9] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[10] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[11] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
LT:
[0] System Slot { System No: 3 } (Engine)
[1] System Slot { System No: 3 } (Engine)
[2] Equipment Slot { [6] ISERSmallLaser }
[3] Equipment Slot { [7] IS Ammo MML-7 SRM }
[4] Equipment Slot { [8] IS Ammo MML-7 LRM }
[5] Equipment Slot { [9] ISRotaryAC2 Ammo }
[6] Equipment Slot { [10] ISCASE, Not hittable }
[7] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[8] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[9] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[10] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[11] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
RA:
[0] System Slot { System No: 7 } (Shoulder)
[1] System Slot { System No: 8 } (Upper Arm)
[2] System Slot { System No: 9 } (Lower Arm)
[3] Equipment Slot { [3] ISLargeXPulseLaser }
[4] Equipment Slot { [3] ISLargeXPulseLaser }
[5] Equipment Slot { [4] ISERMediumLaser }
[6] Equipment Slot { [5] ISERMediumLaser }
[7] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[8] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[9] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[10] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
LA:
[0] System Slot { System No: 7 } (Shoulder)
[1] System Slot { System No: 8 } (Upper Arm)
[2] System Slot { System No: 9 } (Lower Arm)
[3] Equipment Slot { [1] ISRotaryAC2 }
[4] Equipment Slot { [1] ISRotaryAC2 }
[5] Equipment Slot { [1] ISRotaryAC2 }
[6] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[7] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[8] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[9] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
[10] Equipment Slot { [2] IS Heavy Ferro-Fibrous, Not hittable }
RL:
[0] System Slot { System No: 11 } (Hip)
[1] System Slot { System No: 12 } (Upper Leg)
[2] System Slot { System No: 13 } (Lower Leg)
[3] System Slot { System No: 14 } (Foot)
LL:
[0] System Slot { System No: 11 } (Hip)
[1] System Slot { System No: 12 } (Upper Leg)
[2] System Slot { System No: 13 } (Lower Leg)
[3] System Slot { System No: 14 } (Foot)

or

Model: >F<
Equipment:
[0] Clan Endo Steel (LT/RA/LL) {  }
[1] Clan Ferro-Fibrous (RT/LA/RL) {  }
[2] CLLightMG (LA-Pod) { Linked: [15] }
[3] CLLightMG (LA-Pod) { Linked: [15] }
[4] CLLightMG (LA-Pod) { Linked: [15] }
[5] CLLMGA (LA-Pod) { Linked: [15], Bay Weapons: [2], [3], [4] }
[6] CLLightMG (LA-Pod) { Linked: [15] }
[7] CLLightMG (LA-Pod) { Linked: [15] }
[8] CLLightMG (LA-Pod) { Linked: [15] }
[9] CLLMGA (LA-Pod) { Linked: [15], Bay Weapons: [6], [7], [8] }
[10] CLMediumPulseLaser (RA-Pod) {  }
[11] CLMediumPulseLaser (RA-Pod) {  }
[12] CLMediumPulseLaser (RA-Pod) {  }
[13] CLMediumPulseLaser (RA-Pod) {  }
[14] CLMediumPulseLaser (RA-Pod) {  }
[15] Clan Light Machine Gun Ammo - Half (LT-Pod) { LinkedBy: [9], Shots: 100, Size: 0.5 }
[16] CLLightActiveProbe (RT-Pod) {  }
[17] CLMASC (CT) {  }
(rest omitted)

@SJuliez SJuliez merged commit 31fa3c6 into MegaMek:master Dec 21, 2023
4 checks passed
@SJuliez SJuliez deleted the entity-debug-output branch February 4, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants