From da365f126668bf9568dd2c08bea1921d673fb235 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 22 Oct 2024 22:51:01 +0200 Subject: [PATCH] GUI tweaks in the equipment search tab, naval gauss flag fix --- .../advancedsearch/EquipmentCostRenderer.java | 43 ++++++ .../advancedsearch/EquipmentDataRenderer.java | 44 ++++++ .../advancedsearch/EquipmentFilterToken.java | 7 +- .../ui/advancedsearch/NoSelectionModel.java | 19 +++ .../client/ui/advancedsearch/OperatorFT.java | 13 +- .../ui/advancedsearch/TechBaseRenderer.java | 39 ++++++ .../ui/advancedsearch/WeaponClassFT.java | 20 +++ .../ui/advancedsearch/WeaponSearchTab.java | 14 ++ .../src/megamek/common/MekSearchFilter.java | 130 ++++++------------ .../weapons/capitalweapons/NGaussWeapon.java | 42 +++--- 10 files changed, 251 insertions(+), 120 deletions(-) create mode 100644 megamek/src/megamek/client/ui/advancedsearch/EquipmentCostRenderer.java create mode 100644 megamek/src/megamek/client/ui/advancedsearch/EquipmentDataRenderer.java create mode 100644 megamek/src/megamek/client/ui/advancedsearch/TechBaseRenderer.java diff --git a/megamek/src/megamek/client/ui/advancedsearch/EquipmentCostRenderer.java b/megamek/src/megamek/client/ui/advancedsearch/EquipmentCostRenderer.java new file mode 100644 index 0000000000..f4b20f25dc --- /dev/null +++ b/megamek/src/megamek/client/ui/advancedsearch/EquipmentCostRenderer.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. + * + * This file is part of MegaMek. + * + * MegaMek is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MegaMek is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MegaMek. If not, see . + */ +package megamek.client.ui.advancedsearch; + +import javax.swing.*; +import javax.swing.table.DefaultTableCellRenderer; +import java.awt.*; + +public class EquipmentCostRenderer extends DefaultTableCellRenderer { + + public EquipmentCostRenderer() { + super(); + setHorizontalAlignment(SwingConstants.RIGHT); + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + if (value instanceof Double number) { + if (number < 0) { + value = "variable"; + } else { + value = "%,d".formatted(Math.round(number)); + } + } + return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + } +} diff --git a/megamek/src/megamek/client/ui/advancedsearch/EquipmentDataRenderer.java b/megamek/src/megamek/client/ui/advancedsearch/EquipmentDataRenderer.java new file mode 100644 index 0000000000..09aedf2321 --- /dev/null +++ b/megamek/src/megamek/client/ui/advancedsearch/EquipmentDataRenderer.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. + * + * This file is part of MegaMek. + * + * MegaMek is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MegaMek is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MegaMek. If not, see . + */ + +package megamek.client.ui.advancedsearch; + +import javax.swing.*; +import javax.swing.table.DefaultTableCellRenderer; +import java.awt.*; + +public class EquipmentDataRenderer extends DefaultTableCellRenderer { + + public EquipmentDataRenderer() { + super(); + setHorizontalAlignment(SwingConstants.CENTER); + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + + if (value instanceof Integer number && number < 0) { + value = "var."; + } + if (value instanceof Double number && number < 0) { + value = "var."; + } + return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + } +} diff --git a/megamek/src/megamek/client/ui/advancedsearch/EquipmentFilterToken.java b/megamek/src/megamek/client/ui/advancedsearch/EquipmentFilterToken.java index b40b767108..90bee9e8ab 100644 --- a/megamek/src/megamek/client/ui/advancedsearch/EquipmentFilterToken.java +++ b/megamek/src/megamek/client/ui/advancedsearch/EquipmentFilterToken.java @@ -16,10 +16,11 @@ * You should have received a copy of the GNU General Public License * along with MegaMek. If not, see . */ - package megamek.client.ui.advancedsearch; -public class EquipmentFilterToken implements FilterToken { - +/** + * This is a superclass for filter tokens that are actual equipment, not operators or parentheses + */ +public abstract class EquipmentFilterToken implements FilterToken { } diff --git a/megamek/src/megamek/client/ui/advancedsearch/NoSelectionModel.java b/megamek/src/megamek/client/ui/advancedsearch/NoSelectionModel.java index 5b2a0f4d6b..5be5b9a499 100644 --- a/megamek/src/megamek/client/ui/advancedsearch/NoSelectionModel.java +++ b/megamek/src/megamek/client/ui/advancedsearch/NoSelectionModel.java @@ -1,3 +1,22 @@ + +/* + * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. + * + * This file is part of MegaMek. + * + * MegaMek is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MegaMek is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MegaMek. If not, see . + */ package megamek.client.ui.advancedsearch; import javax.swing.*; diff --git a/megamek/src/megamek/client/ui/advancedsearch/OperatorFT.java b/megamek/src/megamek/client/ui/advancedsearch/OperatorFT.java index 769b3e6283..1a2e194ce6 100644 --- a/megamek/src/megamek/client/ui/advancedsearch/OperatorFT.java +++ b/megamek/src/megamek/client/ui/advancedsearch/OperatorFT.java @@ -8,6 +8,7 @@ * @author Arlith */ public abstract class OperatorFT implements FilterToken { + public MekSearchFilter.BoolOp op; protected OperatorFT(MekSearchFilter.BoolOp o) { @@ -16,12 +17,10 @@ protected OperatorFT(MekSearchFilter.BoolOp o) { @Override public String toString() { - if (op == MekSearchFilter.BoolOp.AND) { - return "And"; - } else if (op == MekSearchFilter.BoolOp.OR) { - return "Or"; - } else { - return ""; - } + return switch (op) { + case AND -> "and"; + case OR -> "or"; + default -> ""; + }; } } diff --git a/megamek/src/megamek/client/ui/advancedsearch/TechBaseRenderer.java b/megamek/src/megamek/client/ui/advancedsearch/TechBaseRenderer.java new file mode 100644 index 0000000000..84cc5a68e1 --- /dev/null +++ b/megamek/src/megamek/client/ui/advancedsearch/TechBaseRenderer.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. + * + * This file is part of MegaMek. + * + * MegaMek is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MegaMek is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MegaMek. If not, see . + */ +package megamek.client.ui.advancedsearch; + +import javax.swing.*; +import javax.swing.table.DefaultTableCellRenderer; +import java.awt.*; + +public class TechBaseRenderer extends DefaultTableCellRenderer { + + public TechBaseRenderer() { + super(); + setHorizontalAlignment(SwingConstants.CENTER); + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + if (value.equals("Inner Sphere")) { + value = "IS"; + } + return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + } +} diff --git a/megamek/src/megamek/client/ui/advancedsearch/WeaponClassFT.java b/megamek/src/megamek/client/ui/advancedsearch/WeaponClassFT.java index 5eaa09152a..41755cf8f1 100644 --- a/megamek/src/megamek/client/ui/advancedsearch/WeaponClassFT.java +++ b/megamek/src/megamek/client/ui/advancedsearch/WeaponClassFT.java @@ -1,6 +1,26 @@ + +/* + * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. + * + * This file is part of MegaMek. + * + * MegaMek is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MegaMek is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MegaMek. If not, see . + */ package megamek.client.ui.advancedsearch; public class WeaponClassFT extends EquipmentFilterToken { + public WeaponClass weaponClass; public int qty; diff --git a/megamek/src/megamek/client/ui/advancedsearch/WeaponSearchTab.java b/megamek/src/megamek/client/ui/advancedsearch/WeaponSearchTab.java index f9cf4324db..9535947e12 100644 --- a/megamek/src/megamek/client/ui/advancedsearch/WeaponSearchTab.java +++ b/megamek/src/megamek/client/ui/advancedsearch/WeaponSearchTab.java @@ -27,6 +27,7 @@ import javax.swing.border.EmptyBorder; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableColumn; import javax.swing.table.TableRowSorter; import java.awt.*; @@ -159,6 +160,14 @@ public Dimension getPreferredScrollableViewportSize() { tblWeapons.addKeyListener(this); tblWeapons.addFocusListener(this); + var tableDataRenderer = new EquipmentDataRenderer(); + for (int column : List.of(0, 2, 3, 4, 5, 6)) { + tblWeapons.getColumnModel().getColumn(column).setCellRenderer(tableDataRenderer); + } + + var techBaseRenderer = new TechBaseRenderer(); + tblWeapons.getColumnModel().getColumn(7).setCellRenderer(techBaseRenderer); + for (int i = 0; i < weaponsModel.getColumnCount(); i++) { tblWeapons.getColumnModel().getColumn(i).setPreferredWidth(weaponsModel.getPreferredWidth(i)); } @@ -186,6 +195,11 @@ public Dimension getPreferredScrollableViewportSize() { tblEquipment.getColumnModel().getColumn(i).setPreferredWidth(equipmentModel.getPreferredWidth(i)); } + tblEquipment.getColumnModel().getColumn(0).setCellRenderer(tableDataRenderer); + var costRenderer = new EquipmentCostRenderer(); + tblEquipment.getColumnModel().getColumn(2).setCellRenderer(costRenderer); + tblEquipment.getColumnModel().getColumn(3).setCellRenderer(techBaseRenderer); + scrTableEquipment.setViewportView(tblEquipment); // Populate Tables diff --git a/megamek/src/megamek/common/MekSearchFilter.java b/megamek/src/megamek/common/MekSearchFilter.java index 073ac85774..af143444f0 100644 --- a/megamek/src/megamek/common/MekSearchFilter.java +++ b/megamek/src/megamek/common/MekSearchFilter.java @@ -1,18 +1,22 @@ /* -* MegaMek - -* Copyright (C) 2002, 2003 Ben Mazur (bmazur@sev.org) -* Copyright (C) 2018 The MegaMek Team -* -* This program is free software; you can redistribute it and/or modify it under -* the terms of the GNU General Public License as published by the Free Software -* Foundation; either version 2 of the License, or (at your option) any later -* version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -* details. -*/ + * Copyright (c) 2002, 2003 Ben Mazur (bmazur@sev.org) + * Copyright (c) 2018, 2024 - The MegaMek Team. All Rights Reserved. + * + * This file is part of MegaMek. + * + * MegaMek is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MegaMek is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MegaMek. If not, see . + */ package megamek.common; import java.util.ArrayList; @@ -21,7 +25,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; import java.util.stream.IntStream; import megamek.client.ui.advancedsearch.*; @@ -241,8 +244,7 @@ public void createFilterExpressionFromTokens(List toks) throws Filt } } - private ExpNode createFTFromTokensRecursively(Iterator toks, - ExpNode currNode) { + private ExpNode createFTFromTokensRecursively(Iterator toks, ExpNode currNode) { // Base case. We're out of tokens, so we're done. if (!toks.hasNext()) { return currNode; @@ -251,15 +253,15 @@ private ExpNode createFTFromTokensRecursively(Iterator toks, FilterToken filterTok = toks.next(); // Parsing Parenthesis - if (filterTok instanceof ParensFT) { - if (((ParensFT) filterTok).parens.equals("(")) { + if (filterTok instanceof ParensFT parensFT) { + if (parensFT.parens.equals("(")) { if (currNode == null) { return createFTFromTokensRecursively(toks, null); } else { currNode.children.add(createFTFromTokensRecursively(toks, null)); return currNode; } - } else if (((ParensFT) filterTok).parens.equals(")")) { + } else if (parensFT.parens.equals(")")) { ExpNode nextNode = createFTFromTokensRecursively(toks, null); // This right paren is the end of the expression if (nextNode == null) { @@ -272,8 +274,7 @@ private ExpNode createFTFromTokensRecursively(Iterator toks, } // Parsing an Operation - if (filterTok instanceof OperatorFT) { - OperatorFT ft = (OperatorFT) filterTok; + if (filterTok instanceof OperatorFT ft) { ExpNode newNode = new ExpNode(); // If currNode is null, we came from a right paren if (currNode == null) { @@ -316,23 +317,21 @@ private ExpNode createFTFromTokensRecursively(Iterator toks, } // Parsing an Operand - if (filterTok instanceof EquipmentTypeFT) { + if (filterTok instanceof EquipmentTypeFT ft) { if (currNode == null) { currNode = new ExpNode(); } - EquipmentTypeFT ft = (EquipmentTypeFT) filterTok; ExpNode newChild = new ExpNode(ft.internalName, ft.qty); currNode.children.add(newChild); return createFTFromTokensRecursively(toks, currNode); } - if (filterTok instanceof WeaponClassFT) { + if (filterTok instanceof WeaponClassFT ft) { if (currNode == null) { currNode = new ExpNode(); } - WeaponClassFT ft = (WeaponClassFT) filterTok; ExpNode newChild = new ExpNode(ft.weaponClass, ft.qty); currNode.children.add(newChild); return createFTFromTokensRecursively(toks, currNode); @@ -340,39 +339,10 @@ private ExpNode createFTFromTokensRecursively(Iterator toks, return null; } - public void clearEquipmentCriteria() { - checkEquipment = false; - equipmentCriteria = new ExpressionTree(); - } - public String getEquipmentExpression() { return equipmentCriteria.toString(); } - public static boolean isTechMatch(MekSummary mek, int nTechType) { - return ((nTechType == TechConstants.T_ALL) - || (nTechType == mek.getType()) - || ((nTechType == TechConstants.T_IS_TW_ALL) - && ((mek.getType() <= TechConstants.T_IS_TW_NON_BOX) - || (mek.getType() == TechConstants.T_INTRO_BOXSET))) - || ((nTechType == TechConstants.T_TW_ALL) - && ((mek.getType() <= TechConstants.T_IS_TW_NON_BOX) - || (mek.getType() <= TechConstants.T_INTRO_BOXSET) - || (mek.getType() <= TechConstants.T_CLAN_TW))) - || ((nTechType == TechConstants.T_ALL_IS) - && ((mek.getType() <= TechConstants.T_IS_TW_NON_BOX) - || (mek.getType() == TechConstants.T_INTRO_BOXSET) - || (mek.getType() == TechConstants.T_IS_ADVANCED) - || (mek.getType() == TechConstants.T_IS_EXPERIMENTAL) - || (mek.getType() == TechConstants.T_IS_UNOFFICIAL))) - || ((nTechType == TechConstants.T_ALL_CLAN) - && ((mek.getType() == TechConstants.T_CLAN_TW) - || (mek.getType() == TechConstants.T_CLAN_ADVANCED) - || (mek.getType() == TechConstants.T_CLAN_EXPERIMENTAL) - || (mek.getType() == TechConstants.T_CLAN_UNOFFICIAL)))); - - } - private static boolean isBetween(double value, String sStart, String sEnd) { if (sStart.isEmpty() && sEnd.isEmpty()) { return true; @@ -381,11 +351,7 @@ private static boolean isBetween(double value, String sStart, String sEnd) { int iStart = StringUtil.toInt(sStart, Integer.MIN_VALUE); int iEnd = StringUtil.toInt(sEnd, Integer.MAX_VALUE); - if ((value < iStart) || (value > iEnd)) { - return false; - } - - return true; + return (!(value < iStart)) && (!(value > iEnd)); } private static boolean isMatch(int i, boolean b) { @@ -410,10 +376,6 @@ private static boolean anyMatch(List list, int search) { return list.stream().anyMatch(i -> i == search); } - private static boolean allMatch(List list, int search) { - return list.stream().allMatch(i -> i == search); - } - private static boolean anyMatch(List list, HashSet search) { return list.stream().anyMatch(search::contains); } @@ -1007,14 +969,14 @@ private boolean evaluate(List eq, List qty, ExpNode n) { // First, convert the two separate lists into a map of name->quantity. List> nameQtyPairs = IntStream.range(0, Math.min(eq.size(), qty.size())) .mapToObj(i -> Map.entry(eq.get(i), qty.get(i))) - .collect(Collectors.toList()); + .toList(); // Now, stream that map, filtering on a match with the WeaponClass, then extract // the quantities and sum them up. - Integer total = nameQtyPairs.stream() + int total = nameQtyPairs.stream() .filter(p -> n.weaponClass.matches(p.getKey())) - .map(e -> e.getValue()) - .reduce(0, (a, b) -> a + b); + .map(Map.Entry::getValue) + .reduce(0, Integer::sum); // If the requested quantity is 0, then we match if and only if the total number // of matching equipment is also 0. @@ -1066,11 +1028,7 @@ private boolean evaluate(List eq, List qty, ExpNode n) { // If the leaf quantity is 0, that means that the mek is a match. If the leaf // quantity is non-zero, that means the mek isn't // a match. - if (n.qty == 0) { - return true; - } else { - return false; - } + return n.qty == 0; } } // Otherwise, recurse on all the children and either AND the results @@ -1078,9 +1036,7 @@ private boolean evaluate(List eq, List qty, ExpNode n) { boolean retVal = n.operation == BoolOp.AND; // If we set the proper default starting value of retVal, we can take // advantage of logical short-circuiting. - Iterator childIter = n.children.iterator(); - while (childIter.hasNext()) { - ExpNode child = childIter.next(); + for (ExpNode child : n.children) { if (n.operation == BoolOp.AND) { retVal = retVal && evaluate(eq, qty, child); } else { @@ -1097,7 +1053,7 @@ private boolean evaluate(List eq, List qty, ExpNode n) { * * @author Arlith */ - public class ExpressionTree { + public static class ExpressionTree { private ExpNode root; public ExpressionTree() { @@ -1114,17 +1070,13 @@ public ExpressionTree(ExpressionTree et) { root = new ExpNode(et.root); } - public ExpressionTree(String n, int q) { - root = new ExpNode(n, q); - } - @Override public String toString() { return root.children.isEmpty() ? "" : root.toString(); } } - public class ExpNode { + public static class ExpNode { public ExpNode parent; public BoolOp operation; @@ -1146,14 +1098,14 @@ public ExpNode() { */ public ExpNode(ExpNode e) { parent = null; - this.operation = e.operation; - this.qty = e.qty; + operation = e.operation; + qty = e.qty; // if (e.name != null) { - this.name = e.name; + name = e.name; // } - this.weaponClass = e.weaponClass; + weaponClass = e.weaponClass; Iterator nodeIter = e.children.iterator(); - this.children = new LinkedList<>(); + children = new LinkedList<>(); while (nodeIter.hasNext()) { children.add(new ExpNode(nodeIter.next())); } @@ -1221,11 +1173,9 @@ public String toString() { } - public class FilterParsingException extends Exception { + public static class FilterParsingException extends Exception { public String msg; - private static final long serialVersionUID = 1L; - FilterParsingException(String m) { msg = m; } diff --git a/megamek/src/megamek/common/weapons/capitalweapons/NGaussWeapon.java b/megamek/src/megamek/common/weapons/capitalweapons/NGaussWeapon.java index 3ab911bf31..738a34e203 100644 --- a/megamek/src/megamek/common/weapons/capitalweapons/NGaussWeapon.java +++ b/megamek/src/megamek/common/weapons/capitalweapons/NGaussWeapon.java @@ -1,40 +1,42 @@ -/** - * MegaMek - Copyright (C) 2004,2005 Ben Mazur (bmazur@sev.org) +/* + * Copyright (c) 2004,2005 Ben Mazur (bmazur@sev.org) + * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. + * This file is part of MegaMek. * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ -/* - * Created on Sep 2, 2004 + * MegaMek is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * + * MegaMek is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MegaMek. If not, see . */ package megamek.common.weapons.capitalweapons; import megamek.common.Mounted; import megamek.common.weapons.gaussrifles.GaussWeapon; +import java.io.Serial; + /** + * Naval Gauss Weapon superclass * @author Jay Lawson */ public abstract class NGaussWeapon extends GaussWeapon { - - /** - * - */ + @Serial private static final long serialVersionUID = -2800123131421584210L; public NGaussWeapon() { super(); - this.atClass = CLASS_CAPITAL_GAUSS; - this.capital = true; - flags = flags.andNot(F_PROTO_WEAPON); + atClass = CLASS_CAPITAL_GAUSS; + capital = true; + flags = flags.andNot(F_PROTO_WEAPON).andNot(F_MEK_WEAPON).andNot(F_TANK_WEAPON); } @Override