getChangSheng12StartIndex function

int getChangSheng12StartIndex(
  1. FiveElementsFormat fiveElementClass
)

获取长生12神开始的宫位索引

  • 水二局长生在申
  • 木三局长生在亥
  • 金四局长生在巳
  • 土五局长生在申
  • 火六局长生在寅, @param fiveElementClassName 五行局 @returns 长生12神开始的索引

Implementation

int getChangSheng12StartIndex(FiveElementsFormat fiveElementClass) {
  var startIndex = 0;
  switch (fiveElementClass.value) {
    case 2:
      startIndex = fixEarthlyBranchIndex(EarthlyBranchName.shenEarthly);
    case 3:
      startIndex = fixEarthlyBranchIndex(EarthlyBranchName.haiEarthly);
    case 4:
      startIndex = fixEarthlyBranchIndex(EarthlyBranchName.siEarthly);
    case 5:
      startIndex = fixEarthlyBranchIndex(EarthlyBranchName.shenEarthly);
    case 6:
      startIndex = fixEarthlyBranchIndex(EarthlyBranchName.yinEarthly);
  }
  return startIndex;
}