public Characters.CharacterState GetState(Characters.CharacterType charType, int id) { switch (charType) { case Characters.CharacterType.Priest: return(this.characters.priestStates[id]); case Characters.CharacterType.Evil: return(this.characters.evilStates[id]); default: return(this.configs.DefaultState); } }
public void Embark(Characters.CharacterType charType, int id) { if (this.characters.Embark(charType, id)) { bool isCharOnPos0 = false; Vector3[] posGroup; if (this.characters.BoatState == Characters.CharacterState.OnLeft) { posGroup = this.configs.LeftCharPos; } else { posGroup = this.configs.RightCharPos; } for (int i = 0; i < 3; i++) { if (this.priests[i].Position == posGroup[0] || this.evils[i].Position == posGroup[0]) { isCharOnPos0 = true; break; } } Vector3 tgtPos; if (isCharOnPos0) { tgtPos = posGroup[1]; } else { tgtPos = posGroup[0]; } switch (charType) { case Characters.CharacterType.Priest: this.priests[id].MoveTo(tgtPos); break; case Characters.CharacterType.Evil: this.evils[id].MoveTo(tgtPos); break; } } }
public void Disembark(Characters.CharacterType charType, int id) { if (this.characters.Disembark(charType, id)) { switch (this.characters.BoatState) { case Characters.CharacterState.OnLeft: switch (charType) { case Characters.CharacterType.Priest: this.priests[id].MoveStrategy = this.charMove.Clone(); this.priests[id].MoveTo(this.configs.LeftCharPos[id + 2]); break; case Characters.CharacterType.Evil: this.evils[id].MoveStrategy = this.charMove.Clone(); this.evils[id].MoveTo(this.configs.LeftCharPos[id + this.configs.PeopleNum + 2]); break; } break; case Characters.CharacterState.OnRight: switch (charType) { case Characters.CharacterType.Priest: this.priests[id].MoveStrategy = this.charMove.Clone(); this.priests[id].MoveTo(this.configs.RightCharPos[id + 2]); break; case Characters.CharacterType.Evil: this.evils[id].MoveStrategy = this.charMove.Clone(); this.evils[id].MoveTo(this.configs.RightCharPos[id + this.configs.PeopleNum + 2]); break; } break; } if (this.characters.CharsOnBoat == 0 && !this.characters.IsRunning) { this.ShowResult(); this.objectsOnAnimation++; } } }