예제 #1
0
        /// <summary>
        /// Rafraichi les persos
        /// </summary>
        /// <param name="moveOrAnimation"></param>
        private void RefreshCharacters(int layerIndex, bool main, int playerIndex, bool moveOrAnimation)
        {
            bool playerDrawn = false;

            foreach (VO_StageCharacter item in _Stage.ListCharacters)
            {
                VO_CharacterSprite character = _Service.DrawCharacter(item);
                if (character != null)
                {
                    int characterIndex = _Service.GetLayerIndexFromCharacterLocation(character.Location);
                    if (characterIndex == 0 && main)
                    {
                        characterIndex = layerIndex;
                    }
                    if (playerIndex == 0 && main)
                    {
                        playerIndex = layerIndex;
                    }
                    if (layerIndex == characterIndex)
                    {
                        if (ScriptManager.IsPlayerVisible && !playerDrawn && PlayableCharactersManager.CurrentPlayerCharacter.CharacterSprite.Location.Y < character.Location.Y && playerIndex == layerIndex)
                        {
                            Draw(PlayableCharactersManager.CurrentPlayerCharacter.CharacterSprite, _Service.GetRatioFromMatrix(PlayableCharactersManager.CurrentPlayerCharacter.CharacterSprite.Location, _ProjectData.Resolution.MatrixPrecision), moveOrAnimation);
                            playerDrawn = true;
                        }
                    }
                    Draw(character, _Service.GetRatioFromMatrix(character.Location, _ProjectData.Resolution.MatrixPrecision), moveOrAnimation);
                }
            }
            if ((_Stage.ListCharacters.Count == 0 && (!playerDrawn && playerIndex == layerIndex && ScriptManager.IsPlayerVisible)) || (!playerDrawn && playerIndex == layerIndex && ScriptManager.IsPlayerVisible))
            {
                Draw(PlayableCharactersManager.CurrentPlayerCharacter.CharacterSprite, _Service.GetRatioFromMatrix(PlayableCharactersManager.CurrentPlayerCharacter.CharacterSprite.Location, _ProjectData.Resolution.MatrixPrecision), moveOrAnimation);
            }
        }