Exemple #1
0
        public VinoveGamedat(Vinove _saveVinove)
        {
            _fileDir  = _saveVinove.FileDir;
            _fileName = _saveVinove.FileName;

            _uids       = _saveVinove.UIDs;
            _starterUID = _saveVinove.StarterUID;

            _scenes  = _saveVinove.Scene;
            _branchs = _saveVinove.Branchs;
            _merges  = _saveVinove.Merges;

            _speakerNames            = _saveVinove.SpeakerNames;
            _speakerIllustrations    = _saveVinove.SpeakerIllustrations;
            _backgroundIllustrations = _saveVinove.BackgroundIllustrations;
        }
Exemple #2
0
        /// <summary>
        /// <para>Eng. Change Merge count on VinoveMerge </para>
        /// <para>Kor. 그래프 분기점의 분기 개수를 변경합니다 </para>
        /// </summary>
        /// <param name="_changedCount"> <para> Eng. Wanna change count to this num </para>
        ///                           <para> Kor. 이 값으로 변경하겠습니다. </para> </param>
        /// <param name="_min"> <para> Eng. Minimum value of change target var </para>
        ///                           <para> Kor. 변경 대상 값의 최소값. </para> </param>
        /// <param name="_max"> <para> Eng. Maximum value of change target var </para>
        ///                           <para> Kor. 변경 대상의 최대값. </para> </param>
        public void ChangeMergeCount(Vinove _currentVinove, int _changedCount, int _min, int _max)
        {
            int _mergeCountTmp = _mergeCount;

            _mergeCount = _changedCount;

            if (_changedCount < _min || _changedCount > _max)
            {
                ErrorMessages.Instance.WrongInputRange(_min, _max);
            }
            else if (_mergeCountTmp == _changedCount)
            {   // if, same. no need to change
                return;
            }

            string[] _uidTmp  = new string[_mergeCountTmp];
            Rect[]   _rectTmp = new Rect[_mergeCountTmp];

            for (int i = 0; i < _mergeCountTmp; i++)
            {
                _uidTmp[i]  = _mergeGraphUID[i];
                _rectTmp[i] = _mergeGraphRect[i];
            }

            _mergeGraphUID  = new string[_changedCount];
            _mergeGraphRect = new Rect[_changedCount];

            if (_mergeCountTmp < _changedCount)
            {
                for (int i = 0; i < _mergeCountTmp; i++)
                {
                    _mergeGraphUID[i]  = _uidTmp[i];
                    _mergeGraphRect[i] = _rectTmp[i];
                }
            }
            else
            {
                int _repeatCount;
                for (_repeatCount = 0; _repeatCount < _changedCount; _repeatCount++)
                {
                    _mergeGraphUID[_repeatCount]  = _uidTmp[_repeatCount];
                    _mergeGraphRect[_repeatCount] = _rectTmp[_repeatCount];
                }

                for (; _repeatCount < _mergeCountTmp; _repeatCount++)
                {
                    if (_uidTmp[_repeatCount].StartsWith("MRG"))
                    {
                        VinoveMerge _nextMerge = _currentVinove.FindMergeWithUID(_uidTmp[_repeatCount]);
                        _nextMerge.Next = null;
                    }
                    else if (_uidTmp[_repeatCount].StartsWith("BRA"))
                    {
                        VinoveBranch _nextBranch = _currentVinove.FindBranchWithUID(_uidTmp[_repeatCount]);
                        _nextBranch.BranchsUIDs[_nextBranch.FindUIDLinkIndex(UID)] = null;
                    }
                    else if (_uidTmp[_repeatCount].StartsWith("SCE"))
                    {
                        VinoveScene _nextScene = _currentVinove.FindSceneWithUID(_uidTmp[_repeatCount]);
                        _nextScene.Next = null;
                    }
                }
            }

            SyncLinkerPosition();
        }
Exemple #3
0
        /// <summary>
        /// <para>Eng. Change branch count on VinoveBranch </para>
        /// <para>Kor. 그래프 분기점의 분기 개수를 변경합니다 </para>
        /// </summary>
        /// <param name="_changedCount"> <para> Eng. Wanna change count to this num </para>
        ///                           <para> Kor. 이 값으로 변경하겠습니다. </para> </param>
        /// <param name="_min"> <para> Eng. Minimum value of change target var </para>
        ///                           <para> Kor. 변경 대상 값의 최소값. </para> </param>
        /// <param name="_max"> <para> Eng. Maximum value of change target var </para>
        ///                           <para> Kor. 변경 대상의 최대값. </para> </param>
        public void ChangeBranchCount(Vinove _currentVinove, int _changedCount, int _min, int _max)
        {
            int _branchCountTmp = _branchCount;

            _branchCount = _changedCount;

            if (_changedCount < _min || _changedCount > _max)
            {
                ErrorMessages.Instance.WrongInputRange(_min, _max);
            }
            else if (_branchCountTmp == _changedCount)
            {   // if, same. no need to change
                return;
            }

            string[] _AlterTmp = new string[_branchCountTmp];
            string[] _uidTmp   = new string[_branchCountTmp];
            Rect[]   _rectTmp  = new Rect[_branchCountTmp];

            for (int i = 0; i < _branchCountTmp; i++)
            {   //back up link data before change
                _AlterTmp[i] = _branchAlternatives[i];
                _uidTmp[i]   = _branchGraphUID[i];
                _rectTmp[i]  = _branchGraphRect[i];
            }

            _branchAlternatives = new string[_changedCount];
            _branchGraphUID     = new string[_changedCount];
            _branchGraphRect    = new Rect[_changedCount];
            //re-delegate branch datas

            for (int i = 0; i < _changedCount; i++)
            {
                BranchsAlternatives[i] = "";    // init Alternatives
            }

            if (_branchCountTmp < _changedCount)
            {
                for (int i = 0; i < _branchCountTmp; i++)
                {
                    _branchAlternatives[i] = _AlterTmp[i];
                    _branchGraphUID[i]     = _uidTmp[i];
                    _branchGraphRect[i]    = _rectTmp[i];
                }
            }
            else
            {
                int _repeatCount = 0;
                for (_repeatCount = 0; _repeatCount < _changedCount; _repeatCount++)
                {
                    _branchAlternatives[_repeatCount] = _AlterTmp[_repeatCount];
                    _branchGraphUID[_repeatCount]     = _uidTmp[_repeatCount];
                    _branchGraphRect[_repeatCount]    = _rectTmp[_repeatCount];
                }

                for (; _repeatCount < _branchCountTmp; _repeatCount++)
                {
                    if (_uidTmp[_repeatCount].StartsWith("MRG"))
                    {
                        VinoveMerge _nextMerge = _currentVinove.FindMergeWithUID(_uidTmp[_repeatCount]);
                        _nextMerge.MergeUIDs[_nextMerge.FindUIDLinkIndex(UID)] = null;
                    }
                    else if (_uidTmp[_repeatCount].StartsWith("BRA"))
                    {
                        VinoveBranch _nextBranch = _currentVinove.FindBranchWithUID(_uidTmp[_repeatCount]);
                        _nextBranch.Prev = null;
                    }
                    else if (_uidTmp[_repeatCount].StartsWith("SCE"))
                    {
                        VinoveScene _nextScene = _currentVinove.FindSceneWithUID(_uidTmp[_repeatCount]);
                        _nextScene.Prev = null;
                    }
                }
            }

            SyncLinkerPosition();
        }