Ejemplo n.º 1
0
        public static AutoTileSettings Default4(int originX, int originY)
        {
            AutoTileSettings ret = new AutoTileSettings(new Point(originX, originY));

            for (int i = 0; i < 256; i++)
            {
                if (checkBit(2, i))
                {
                    ret.setTile(i, new Point(originX, originY));
                }
                else if (checkBit(0, i))
                {
                    ret.setTile(i, new Point(originX + 1, originY));
                }
                else if (checkBit(3, i))
                {
                    ret.setTile(i, new Point(originX + 2, originY));
                }
                else
                {
                    ret.setTile(i, new Point(originX + 3, originY));
                }
            }
            ret.Size = 4;
            ret.Name = originX.ToString() + "," + originY.ToString();
            return(ret);
        }
Ejemplo n.º 2
0
            public AutoTileSettings Initialize()
            {
                AutoTileSettings ret = null;

                switch (Size)
                {
                case 3:
                    ret      = Default3(Origin.X, Origin.Y);
                    ret.Name = Name;
                    break;

                case 4:
                    ret      = Default4(Origin.X, Origin.Y);
                    ret.Name = Name;
                    break;

                case 13:
                    ret      = Default13(Origin.X, Origin.Y);
                    ret.Name = Name;
                    break;

                case 47:
                    ret      = Default47(Origin.X, Origin.Y);
                    ret.Name = Name;
                    break;
                }
                ret.Size2 = Size2;
                return(ret);
            }
Ejemplo n.º 3
0
        public static AutoTileSettings Default47(int originX, int originY)
        {
            AutoTileSettings ret = new AutoTileSettings(new Point(originX, originY));

            for (int i = 0; i < 256; i++)
            {
                if (!checkBit(0, i))
                {
                    if (!checkBit(2, i))
                    {
                        if (!checkBit(1, i))
                        {
                            if (!checkBit(3, i))
                            {
                                ret.setTile(i, new Point(originX, originY));
                            }
                            else
                            {
                                ret.setTile(i, new Point(originX + 3, originY));
                            }
                        }
                        else if (!checkBit(3, i))
                        {
                            ret.setTile(i, new Point(originX + 1, originY));
                        }
                        else
                        {
                            ret.setTile(i, new Point(originX + 2, originY));
                        }
                    }
                    else if (!checkBit(3, i))
                    {
                        if (!checkBit(1, i))
                        {
                            ret.setTile(i, new Point(originX, originY + 1));
                        }
                        else
                        {
                            if (!checkBit(5, i))
                            {
                                ret.setTile(i, new Point(originX + 6, originY));
                            }
                            else
                            {
                                ret.setTile(i, new Point(originX + 1, originY + 1));
                            }
                        }
                    }
                    else if (!checkBit(1, i))
                    {
                        if (!checkBit(6, i))
                        {
                            ret.setTile(i, new Point(originX + 7, originY));
                        }
                        else
                        {
                            ret.setTile(i, new Point(originX + 3, originY + 1));
                        }
                    }
                    else if (!checkBit(5, i))
                    {
                        if (!checkBit(6, i))
                        {
                            ret.setTile(i, new Point(originX + 6, originY + 4));
                        }
                        else
                        {
                            ret.setTile(i, new Point(originX + 4, originY + 2));
                        }
                    }
                    else if (!checkBit(6, i))
                    {
                        ret.setTile(i, new Point(originX + 5, originY + 2));
                    }
                    else
                    {
                        ret.setTile(i, new Point(originX + 2, originY + 1));
                    }
                }
                else if (!checkBit(2, i))
                {
                    if (!checkBit(1, i))
                    {
                        if (!checkBit(3, i))
                        {
                            ret.setTile(i, new Point(originX, originY + 3));
                        }
                        else if (!checkBit(7, i))
                        {
                            ret.setTile(i, new Point(originX + 7, originY + 1));
                        }
                        else
                        {
                            ret.setTile(i, new Point(originX + 3, originY + 3));
                        }
                    }
                    else if (!checkBit(3, i))
                    {
                        if (!checkBit(4, i))
                        {
                            ret.setTile(i, new Point(originX + 6, originY + 1));
                        }
                        else
                        {
                            ret.setTile(i, new Point(originX + 1, originY + 3));
                        }
                    }
                    else if (!checkBit(4, i))
                    {
                        if (!checkBit(7, i))
                        {
                            ret.setTile(i, new Point(originX + 7, originY + 5));
                        }
                        else
                        {
                            ret.setTile(i, new Point(originX + 4, originY + 3));
                        }
                    }
                    else if (!checkBit(7, i))
                    {
                        ret.setTile(i, new Point(originX + 5, originY + 3));
                    }
                    else
                    {
                        ret.setTile(i, new Point(originX + 2, originY + 3));
                    }
                }
                else if (!checkBit(3, i))
                {
                    if (!checkBit(1, i))
                    {
                        ret.setTile(i, new Point(originX, originY + 2));
                    }
                    else
                    {
                        if (!checkBit(4, i))
                        {
                            if (!checkBit(5, i))
                            {
                                ret.setTile(i, new Point(originX + 6, originY + 5));
                            }
                            else
                            {
                                ret.setTile(i, new Point(originX + 6, originY + 3));
                            }
                        }
                        else
                        {
                            if (!checkBit(5, i))
                            {
                                ret.setTile(i, new Point(originX + 6, originY + 2));
                            }
                            else
                            {
                                ret.setTile(i, new Point(originX + 1, originY + 2));
                            }
                        }
                    }
                }
                else if (!checkBit(1, i))
                {
                    if (!checkBit(6, i))
                    {
                        if (!checkBit(7, i))
                        {
                            ret.setTile(i, new Point(originX + 7, originY + 4));
                        }
                        else
                        {
                            ret.setTile(i, new Point(originX + 7, originY + 2));
                        }
                    }
                    else
                    {
                        if (!checkBit(7, i))
                        {
                            ret.setTile(i, new Point(originX + 7, originY + 3));
                        }
                        else
                        {
                            ret.setTile(i, new Point(originX + 3, originY + 2));
                        }
                    }
                }
                else
                {
                    if (!checkBit(4, i))
                    {
                        if (!checkBit(5, i))
                        {
                            if (!checkBit(6, i))
                            {
                                if (!checkBit(7, i))
                                {
                                    ret.setTile(i, new Point(originX, originY + 4));
                                }
                                else
                                {
                                    ret.setTile(i, new Point(originX + 1, originY + 5));
                                }
                            }
                            else
                            {
                                if (!checkBit(7, i))
                                {
                                    ret.setTile(i, new Point(originX + 1, originY + 4));
                                }
                                else
                                {
                                    ret.setTile(i, new Point(originX + 4, originY + 4));
                                }
                            }
                        }
                        else
                        {
                            if (!checkBit(6, i))
                            {
                                if (!checkBit(7, i))
                                {
                                    ret.setTile(i, new Point(originX + 2, originY + 4));
                                }
                                else
                                {
                                    ret.setTile(i, new Point(originX + 5, originY + 5));
                                }
                            }
                            else
                            {
                                if (!checkBit(7, i))
                                {
                                    ret.setTile(i, new Point(originX + 3, originY + 4));
                                }
                                else
                                {
                                    ret.setTile(i, new Point(originX + 4, originY + 1));
                                }
                            }
                        }
                    }
                    else
                    {
                        if (!checkBit(5, i))
                        {
                            if (!checkBit(6, i))
                            {
                                if (!checkBit(7, i))
                                {
                                    ret.setTile(i, new Point(originX + 2, originY + 5));
                                }
                                else
                                {
                                    ret.setTile(i, new Point(originX + 3, originY + 5));
                                }
                            }
                            else
                            {
                                if (!checkBit(7, i))
                                {
                                    ret.setTile(i, new Point(originX + 5, originY + 4));
                                }
                                else
                                {
                                    ret.setTile(i, new Point(originX + 4, originY));
                                }
                            }
                        }
                        else
                        {
                            if (!checkBit(6, i))
                            {
                                if (!checkBit(7, i))
                                {
                                    ret.setTile(i, new Point(originX + 4, originY + 5));
                                }
                                else
                                {
                                    ret.setTile(i, new Point(originX + 5, originY));
                                }
                            }
                            else
                            {
                                if (!checkBit(7, i))
                                {
                                    ret.setTile(i, new Point(originX + 5, originY + 1));
                                }
                                else
                                {
                                    ret.setTile(i, new Point(originX + 2, originY + 2));
                                }
                            }
                        }
                    }
                }
            }
            ret.Size = 47;
            ret.Name = originX.ToString() + "," + originY.ToString();
            return(ret);
        }