-
Notifications
You must be signed in to change notification settings - Fork 128
Add transceiver (#146) #1111
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
base: dev/1.21.1
Are you sure you want to change the base?
Add transceiver (#146) #1111
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
| import java.util.concurrent.CopyOnWriteArrayList; | ||
| import java.util.concurrent.atomic.AtomicInteger; | ||
|
|
||
| public class RoundRobinList<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls fully implement List or at least make it iterable, so that an enhanced for loop can be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need these icons?
| } | ||
|
|
||
| private Set<Channel> calculateAvailableChannels(Set<Channel> allChannels, Set<Channel> sendChannels, Set<Channel> receiveChannels) { | ||
| Set<Channel> availableChannels = new LinkedHashSet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason to use a LinkedHashSet instead of the usual HashSet here? Creating a copy of AllChannels and removingAll receive/send channels might be simpler
| public Config(TransceiverScreen screen, Set<Channel> availableChannels, Set<Channel> sendChannels, Set<Channel> receiveChannels, int x, int y, int width, int height) { | ||
| this.screen = Objects.requireNonNull(screen, "Screen cannot be null"); | ||
| this.availableChannels = Objects.requireNonNull(availableChannels, "Available channels cannot be null"); | ||
| this.sendChannels = Objects.requireNonNull(sendChannels, "Send channels cannot be null"); | ||
| this.receiveChannels = Objects.requireNonNull(receiveChannels, "Receive channels cannot be null"); | ||
| this.x = x; | ||
| this.y = y; | ||
| this.width = width; | ||
| this.height = height; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix indentation
|
|
||
| private static final int CHANNEL_NAME_MAX_LENGTH = 50; | ||
|
|
||
| public record Config(TransceiverScreen screen, Set<Channel> availableChannels, Set<Channel> sendChannels, Set<Channel> receiveChannels, int x, int y, int width, int height) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move inner classes below the methods/fields of the outer class
| return new IconButton(x, y, 16, 16, ICON_ARROWS, Component.empty(), this::handleReceiveButton); | ||
| } | ||
|
|
||
| private ChannelOperations createChannelOperations(TransceiverScreen screen) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason that ChannelOperations is an interface with a single anonymous impl? Can it be turned into a normal class?
| import java.util.Set; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| public class ChannelList extends EnumMap<ChannelType, LinkedHashSet<Channel>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this a LinkedHashSet?
Description
Added the dimensiional transceiver back to the game !
TODO
Checklist