Package megamek.common.util
Class C3Util
java.lang.Object
megamek.common.util.C3Util
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbroadcastChanges(Game game, Entity entity) connect(Game game, Collection<Entity> entities, int masterID, boolean disconnectFirst) Connects the passed entities to a standard C3M identified by masterID.static voidcopyC3Networks(Entity source, Entity target) Copies the C3 network setup from the source to the target.disconnectFromNetwork(Game game, Collection<Entity> entities) Disconnects the passed entities from their C3 network, if any.static voidjoinNh(Game game, Collection<Entity> entities, int masterID, boolean disconnectFirst) Connects the passed entities to a non-hierarchic C3 (NC3, C3i or Nova CEWS) identified by masterID.static booleansameNhC3System(Entity a, Entity b) Returns true if a and b share at least one non-hierarchic C3 system (C3i, Naval C3, Nova CEWS).static voidsetCompanyMaster(Collection<Entity> entities) Sets the entities' C3M to act as a Company Master.static voidsetLanceMaster(Collection<Entity> entities) Sets the entities' C3M to act as a Lance Master (aka normal mode).Adds C3 connections when new units are being added.
-
Constructor Details
-
C3Util
public C3Util()
-
-
Method Details
-
wireC3
Adds C3 connections when new units are being added.- Parameters:
game- The Game the unit is being added to, the unit should already be in the Game.entity- The entity being added.- Returns:
- A list of units affected
-
disconnectFromNetwork
Disconnects the passed entities from their C3 network, if any. Due to the way C3 networks are represented in Entity, units cannot disconnect from a C3 network with an id that is the entity's own id. -
setCompanyMaster
Sets the entities' C3M to act as a Company Master.- Throws:
C3Util.MissingC3MException
-
setLanceMaster
Sets the entities' C3M to act as a Lance Master (aka normal mode).- Throws:
C3Util.MissingC3MException
-
sameNhC3System
Returns true if a and b share at least one non-hierarchic C3 system (C3i, Naval C3, Nova CEWS). Symmetrical (the order of a and b does not matter). -
joinNh
public static void joinNh(Game game, Collection<Entity> entities, int masterID, boolean disconnectFirst) throws C3Util.MismatchingC3MException, C3Util.C3CapacityException Connects the passed entities to a non-hierarchic C3 (NC3, C3i or Nova CEWS) identified by masterID. -
connect
public static Set<Entity> connect(Game game, Collection<Entity> entities, int masterID, boolean disconnectFirst) throws C3Util.MismatchingC3MException, C3Util.C3CapacityException Connects the passed entities to a standard C3M identified by masterID. -
broadcastChanges
-
copyC3Networks
Copies the C3 network setup from the source to the target.
-