Exemple #1
0
    void Start()
    {
        /* Initialize WorkArea */
        ValuePrevious           = int.MaxValue;
        FlagPaddingZeroPrevious = FlagPaddingZero;

        /* Initialize Animation-Datas */
        if (null != InstanceRoot)
        {
            /* Start Animation */
            int IndexAnimation = InstanceRoot.IndexGetAnimation("Digit08");
            if (0 <= IndexAnimation)
            {
                InstanceRoot.AnimationPlay(IndexAnimation, 1);
                InstanceRoot.AnimationStop();
            }

            /* Get Digit-Parts */
            for (int i = 0; i < (int)Constant.DIGIT_MAX; i++)
            {
                IDPartsDigit[i] = InstanceRoot.IDGetParts(NameParts[i]);
            }

            /* Get Characters' Cell Index */
            Library_SpriteStudio.Data.CellMap InstanceDataCellMap = InstanceRoot.DataCellMap.DataGetCellMap(0);
            for (int i = 0; i < (int)KindCharacter.TERMINATOR; i++)
            {
                IndexCell[i] = InstanceDataCellMap.IndexGetCell(NameCells[i]);
            }
        }
    }
    private bool FontSet(int IndexKindFont)
    {
        if (null == InstanceRoot)
        {
            return(false);
        }

        int Index = ((0 > IndexKindFont) || ((int)Constant.FONT_MAX <= IndexKindFont)) ? 0 : IndexKindFont;
        int Count = (int)KindCharacter.TERMINATOR;

        Library_SpriteStudio.Data.CellMap InstanceDataCellMap = InstanceRoot.DataCellMap.DataGetCellMap(0);
        if (null == InstanceDataCellMap)
        {
            return(false);
        }

        string[] ListNameCell = NameCells[Index];
        int      IndexCell;

        for (int i = 0; i < Count; i++)
        {
            IndexCell = InstanceDataCellMap.IndexGetCell(ListNameCell[i]);
            if (0 > IndexCell)
            {                   /* Error */
                WorkAreaFontCell[i].IndexCell        = -1;
                WorkAreaFontCell[i].InstanceDataCell = null;
                continue;
            }

            WorkAreaFontCell[i].IndexCell        = IndexCell;
            WorkAreaFontCell[i].InstanceDataCell = InstanceDataCellMap.DataGetCell(IndexCell);
        }

        return(true);
    }
            /* ******************************************************** */
            //! Create "Cell-Map Change"-Table (1 Cell-Map)

            /*!
             * @param	InstanceCellMap
             *      Original "Cell-Map"
             * @param	IndexTexture
             *      Index of Texture (in the Material-Table)
             * @retval	Return-Value
             *      Created "Cell-Map Change"-Table (1 Cell-Map)<br>
             *      null == Failure
             *
             * Create the "Cell-Map Change"-Table on the basis of the original "Cell-Map" information.<br>
             * Caution: The result is referencing data in original "Cell-Map".
             */
            public static Library_SpriteStudio.Control.CellChange[] CellMapCreate(Library_SpriteStudio.Data.CellMap InstanceCellMap, int IndexTexture)
            {
                Library_SpriteStudio.Control.CellChange[] Rv = null;
                if (null != InstanceCellMap)
                {
                    Library_SpriteStudio.Data.Cell DataCell = null;
                    if (null != InstanceCellMap.ListCell)
                    {
                        int Count = InstanceCellMap.ListCell.Length;
                        Rv = new Library_SpriteStudio.Control.CellChange[Count];
                        if (null != Rv)
                        {
                            for (int i = 0; i < Count; i++)
                            {
                                DataCell = InstanceCellMap.ListCell[i];
                                if (null == DataCell)
                                {                                       /* Invalid */
                                    Rv[i].CleanUp();
                                }
                                else
                                {
                                    Rv[i].DataSet(IndexTexture, InstanceCellMap, DataCell);
                                }
                            }
                        }
                    }
                    else
                    {                           /* Has no Cells */
                        Rv = new Library_SpriteStudio.Control.CellChange[0];
                    }
                }
                return(Rv);
            }
            /* ******************************************************** */
            //! Copy "Cell-Map Change"-Table

            /*!
             * @param	ListCellMap
             *      Original "Cell-Map"s
             * @retval	Return-Value
             *      Created "Cell-Map Change"-Table<br>
             *      null == Failure
             *
             * Create the "Cell-Map Change"-Table on the basis of the original "Cell-Map" information of the animation data.<br>
             * Caution: The result is referencing data in original "Cell-Map"s. (but "Cell" data is another instance)
             */
            public static Library_SpriteStudio.Control.CellChange[][] Copy(Library_SpriteStudio.Data.CellMap[] ListCellMap)
            {
                Library_SpriteStudio.Control.CellChange[][] Rv = null;
                if (null != ListCellMap)
                {
                    int Count = ListCellMap.Length;
                    Rv = new Library_SpriteStudio.Control.CellChange[Count][];
                    if (null != Rv)
                    {
                        Library_SpriteStudio.Data.CellMap CellMapNew = null;
                        if (null != CellMapNew)
                        {
                            for (int i = 0; i < Count; i++)
                            {
                                CellMapNew = new Library_SpriteStudio.Data.CellMap();
                                CellMapNew.Duplicate(ListCellMap[i]);
                                Rv[i] = CellMapCopy(CellMapNew, i);

                                CellMapNew.ListCell = null;                                     /* Dis-Use */
                            }
                        }
                    }
                }
                return(Rv);
            }
            /* ******************************************************** */
            //! Set Cell's data

            /*!
             * @param	InstanceTableCellChange
             *      "Cell-Map Change"-Table
             * @param	IndexCellMap
             *      Index of "Cell-Map"
             * @param	IndexCell
             *      Index of Cell in "Cell-Map"
             * @param	IndexTexture
             *      Index of Texture (in Material-Table)
             * @param	InstanceCellMap
             *      "Cell-Map" Data
             * @param	InstanceCell
             *      Cell Data
             * @retval	Return-Value
             *      true == "Output" is valid<br>
             *      false == "Output" is invalid
             *
             * Set cell data in "Cell-Map Change"-Table.<br>
             * Caution: "InstanceCellMap" and "InstanceCell" are referenced.
             */
            public static bool CellSet(Library_SpriteStudio.Control.CellChange[][] InstanceTableCellChange,
                                       int IndexCellMap,
                                       int IndexCell,
                                       int IndexTexture,
                                       Library_SpriteStudio.Data.CellMap InstanceCellMap,
                                       Library_SpriteStudio.Data.Cell InstanceCell
                                       )
            {
                if (false == TableCheckValidIndex(InstanceTableCellChange, IndexCellMap, IndexCell))
                {
                    return(false);
                }

                InstanceTableCellChange[IndexCellMap][IndexCell].DataSet(IndexTexture, InstanceCellMap, InstanceCell);
                return(true);
            }
Exemple #6
0
    /* ******************************************************** */
    //! Get Cell count

    /*!
     * @param	IndexCellMap
     *      "Cell-Map"'s Index
     * @param	FlagConsideringChanged
     *      true == Auto<br>
     *      false == Initially-Set, force<br>
     *      Default: false
     * @retval	Return-Value
     *      Count of "Cell-Map"s<br>
     *      -1 == Failure (Error)
     *
     * Get count of Cells in the "Cell-Map".<br>
     * <br>
     * When "FlagConsideringChanged" is true, this function returns the number of cell in "Cell-Map"s of the changed (If "Cell-Map"-Table has been changed).
     */
    public int CountGetCell(int IndexCellMap, bool FlagConsideringChanged = false)
    {
        if ((true == FlagConsideringChanged) && (null != TableCellChange))
        {
            return(Library_SpriteStudio.Utility.TableCellChange.CountGetCell(TableCellChange, IndexCellMap));
        }

        if (null != DataCellMap)
        {
            Library_SpriteStudio.Data.CellMap InstanceCellMap = DataCellMap.DataGetCellMap(IndexCellMap);
            if (null == InstanceCellMap)
            {
                return(-1);
            }
            return(InstanceCellMap.CountGetCell());
        }

        return(-1);
    }
            /* ******************************************************** */
            //! Full-Copy "Cell-Map Change"-Table (1 Cell-Map)

            /*!
             * @param	InstanceCellMap
             *      Original "Cell-Map"
             * @param	IndexTexture
             *      Index of Texture (in the Material-Table)
             * @retval	Return-Value
             *      Created "Cell-Map Change"-Table (1 Cell-Map)<br>
             *      null == Failure
             *
             * Create the "Cell-Map Change"-Table on the basis of the original "Cell-Map" information.<br>
             * Caution: The result is another instance from original "Cell-Map"s.
             */
            public static Library_SpriteStudio.Control.CellChange[] CellMapCopyFull(Library_SpriteStudio.Data.CellMap InstanceCellMap, int IndexTexture)
            {
                Library_SpriteStudio.Control.CellChange[] Rv = null;
                if (null != InstanceCellMap)
                {
                    Library_SpriteStudio.Data.Cell DataCell = null;
                    if (null != InstanceCellMap.ListCell)
                    {
                        Library_SpriteStudio.Data.CellMap DataCellMapNew = null;
                        Library_SpriteStudio.Data.Cell    DataCellNew    = null;
                        int Count = InstanceCellMap.ListCell.Length;
                        Rv = new Library_SpriteStudio.Control.CellChange[Count];
                        if (null != Rv)
                        {
                            for (int i = 0; i < Count; i++)
                            {
                                DataCell = InstanceCellMap.ListCell[i];
                                if (null == DataCell)
                                {                                       /* Invalid */
                                    Rv[i].CleanUp();
                                }
                                else
                                {
                                    DataCellMapNew = new Library_SpriteStudio.Data.CellMap();
                                    DataCellMapNew.Duplicate(InstanceCellMap);
                                    DataCellMapNew.ListCell = null;                                     /* Dis-Use */

                                    DataCellNew = new Library_SpriteStudio.Data.Cell();
                                    DataCellNew.Duplicate(DataCell);

                                    Rv[i].DataSet(IndexTexture, DataCellMapNew, DataCellNew);
                                }
                            }
                        }
                    }
                    else
                    {                           /* Has no Cells */
                        Rv = new Library_SpriteStudio.Control.CellChange[0];
                    }
                }
                return(Rv);
            }
            /* ******************************************************** */
            //! Set Cell's data

            /*!
             * @param	InstanceTableCellChange
             *      "Cell-Map Change"-Table
             * @param	IndexCellMap
             *      Index of "Cell-Map"
             * @param	IndexCell
             *      Index of Cell in "Cell-Map"
             * @param	IndexTexture
             *      Index of Texture (in Material-Table)
             * @param	InstanceCellMap
             *      "Cell-Map" Data
             * @param	InstanceCell
             *      Cell Data
             * @retval	Return-Value
             *      true == "Output" is valid<br>
             *      false == "Output" is invalid
             *
             * Set cell data in "Cell-Map Change"-Table.<br>
             * Caution: Cell data is not referencing "InstanceCellMap" and "InstanceCell".
             */
            public static bool CellSetFull(Library_SpriteStudio.Control.CellChange[][] InstanceTableCellChange,
                                           int IndexCellMap,
                                           int IndexCell,
                                           int IndexTexture,
                                           Library_SpriteStudio.Data.CellMap InstanceCellMap,
                                           Library_SpriteStudio.Data.Cell InstanceCell
                                           )
            {
                if (false == TableCheckValidIndex(InstanceTableCellChange, IndexCellMap, IndexCell))
                {
                    return(false);
                }

                Library_SpriteStudio.Data.CellMap InstanceCellMapNew = new Library_SpriteStudio.Data.CellMap();
                InstanceCellMapNew.Duplicate(InstanceCellMap);
                InstanceCellMapNew.ListCell = null;                     /* Dis-Use */

                Library_SpriteStudio.Data.Cell InstanceCellNew = new Library_SpriteStudio.Data.Cell();
                InstanceCellNew.Duplicate(InstanceCell);

                InstanceTableCellChange[IndexCellMap][IndexCell].DataSet(IndexTexture, InstanceCellMapNew, InstanceCellNew);
                return(true);
            }
Exemple #9
0
    /* ******************************************************** */
    //! Get Cell's Index

    /*!
     * @param	IndexCellMap
     *      "Cell-Map"'s Index
     * @param	Name
     *      Cell's Name
     * @param	FlagConsideringChanged
     *      true == Auto<br>
     *      false == Initially-Set, force<br>
     *      Default: false
     * @retval	Return-Value
     *      Cell's Index<br>
     *      -1 == Not-Found / Failure (Error)
     *
     * Get Cell's Index.<br>
     * <br>
     * When "FlagConsideringChanged" is true, this function returns the index of cell in "Cell-Map"s of the changed (If "Cell-Map"-Table has been changed).
     */
    public int IndexGetCell(int IndexCellMap, string NameCell, bool FlagConsideringChanged = false)
    {
        if (true == string.IsNullOrEmpty(NameCell))
        {
            return(-1);
        }

        if ((true == FlagConsideringChanged) && (null != TableCellChange))
        {
            return(Library_SpriteStudio.Utility.TableCellChange.IndexGetCell(TableCellChange, IndexCellMap, NameCell));
        }

        if (null != DataCellMap)
        {
            Library_SpriteStudio.Data.CellMap InstanceCellMap = DataCellMap.DataGetCellMap(IndexCellMap);
            if (null == InstanceCellMap)
            {
                return(-1);
            }
            return(InstanceCellMap.IndexGetCell(NameCell));
        }

        return(-1);
    }