/// <summary> /// Prépare un perso à être dessiné. /// </summary> /// <param name="character"></param> /// <returns></returns> public VO_CharacterSprite DrawCharacter(VO_StageCharacter character) { int i = 0; foreach (VO_Page page in character.Event.PageList) { if (IsActivePage(page)) { VO_CharacterSprite characterSprite = GetCharacterSprite(character.Id); if (characterSprite.CurrentExecutingPage != i) { characterSprite.Speed = page.CharacterSpeed; characterSprite.StandingAnim = page.CharacterStandingType; characterSprite.WalkingAnim = page.CharacterWalkingType; characterSprite.TalkingAnim = page.CharacterTalkingType; characterSprite.CurrentDirection = page.CharacterDirection; characterSprite.SetCurrentAnimation(Enums.CharacterAnimationType.Standing, page.CharacterStandingType); characterSprite.SetCurrentAnimationFrequency(page.CharacterAnimationFrequency); characterSprite.CurrentExecutingPage = i; } return(characterSprite); } i++; } return(null); }
/// <summary> /// Charge les PNJ /// </summary> /// <returns></returns> public static void LoadGamePNJ() { foreach (VO_GameStateCharacter character in State.CurrentStagePNJ) { VO_CharacterSprite characterSprite = _Service.GetCharacterSprite(character.Id); characterSprite.SetPosition(character.Coords.Location.X, character.Coords.Location.Y); characterSprite.CurrentDirection = character.CurrentDirection; characterSprite.Id = character.Id; characterSprite.CharacterId = character.CharacterId; characterSprite.CurrentExecutingPage = character.CurrentExecutingPage; characterSprite.IsTalking = character.IsTalking; characterSprite.CurrentPath = character.CurrentPath; characterSprite.SetCurrentAnimation(characterSprite.CurrentCharacterAnimationType, character.CurrentAnim); } }