MCPcopy Create free account
hub / github.com/PCGen/pcgen / checkSourceEquality

Method checkSourceEquality

code/src/java/pcgen/gui2/PCGenFrame.java:508–537  ·  view source on GitHub ↗
(SourceSelectionFacade source1, SourceSelectionFacade source2)

Source from the content-addressed store, hash-verified

506 }
507
508 private boolean checkSourceEquality(SourceSelectionFacade source1, SourceSelectionFacade source2)
509 {
510 if (source1 == source2)
511 {
512 return true;
513 }
514 if (source1 == null ^ source2 == null)
515 {
516 return false;
517 }
518 //we use reference equality since GameModes come from a fixed database
519 if (source1.getGameMode().get() != source2.getGameMode().get())
520 {
521 return false;
522 }
523 ListFacade<Campaign> campaigns1 = source1.getCampaigns();
524 ListFacade<Campaign> campaigns2 = source2.getCampaigns();
525 if (campaigns1.getSize() != campaigns2.getSize())
526 {
527 return false;
528 }
529 for (Campaign campaign : campaigns1)
530 {
531 if (!campaigns2.containsElement(campaign))
532 {
533 return false;
534 }
535 }
536 return true;
537 }
538
539 private static boolean checkGameModeEquality(SourceSelectionFacade source1, SourceSelectionFacade source2)
540 {

Callers 3

loadSourceSelectionMethod · 0.95
loadCharacterFromFileMethod · 0.95
loadPartyFromFileMethod · 0.95

Calls 5

getMethod · 0.65
getGameModeMethod · 0.65
getCampaignsMethod · 0.65
getSizeMethod · 0.65
containsElementMethod · 0.65

Tested by

no test coverage detected