Exemple #1
0
    void GenerateRooms(Spire spire, float baseHeight)
    {
        for (int roomIndex = 0; roomIndex < roomsInEachSpire; roomIndex++)
        {
            GameObject room    = Instantiate(GetRandomRoom(spire), transform);
            Vector3    roomPos = room.transform.position;
            roomPos.y = baseHeight;
            room.transform.position    = roomPos;
            room.transform.eulerAngles = new Vector3(0, spireRotation, 0);


            baseHeight    += roomHeight;
            spireRotation += roomDegrees;


            //generate stairs
            for (int stairIndex = 0; stairIndex < stairsBetweenRooms; stairIndex++)
            {
                GameObject stair    = Instantiate(GetStair(spire), transform);
                Vector3    stairPos = stair.transform.position;
                stairPos.y = baseHeight;
                stair.transform.position    = stairPos;
                stair.transform.eulerAngles = new Vector3(0, spireRotation, 0);

                spireRotation += stairDegrees;
                baseHeight    += stairHeight;
                if (stairIndex == stairsBetweenRooms - 1)
                {
                    baseHeight    += lastStairHeight;
                    spireRotation += lastStairDegrees;
                }
            }
        }
    }
Exemple #2
0
    Spire GetRandomSpire()
    {
        Spire getSpire = spires [Random.Range(0, spires.Count)];

        while (getSpire.name == lastSpire.name)
        {
            getSpire = spires [Random.Range(0, spires.Count)];
        }
        lastSpire = getSpire;


        return(getSpire);
    }
Exemple #3
0
    void GenerateSpire()
    {
        Spire spire = GetRandomSpire();

        GameObject SpirePollObj = Instantiate(spire.spirePole, transform);
        Vector3    spirePollPos = new Vector3(0, currentSpireHeight, 0);

        SpirePollObj.transform.localPosition = spirePollPos;

        GenerateRooms(spire, currentSpireHeight);

        currentSpireHeight += spireHeight;
        allowGenerate       = true;
    }
Exemple #4
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    /// <summary>
    //
    /// </summary>
    /// <returns>
    //  WorldObject
    /// </returns>
    public WorldObject GetAttackObject()
    {
        // Return the center core if all the spires are destroyed
        bool core = true;

        for (int i = 0; i < Spires.Count; i++)
        {
            if (Spires[i].GetHitPoints() > 0)
            {
                core = false;
                break;
            }
        }
        if (core)
        {
            return(this);
        }

        // Theres a spire still alive so return that instead
        Spire spire = null;
        bool  match = false;

        while (!match)
        {
            int i = Random.Range(0, Spires.Count);
            if (Spires[i].GetHitPoints() > 0)
            {
                spire = Spires[i];
                match = true;
                break;
            }
        }
        if (spire != null)
        {
            return(spire);
        }
        else
        {
            return(this);
        }                     /// This should never hit but is a precaution so there isnt a null returned
    }
Exemple #5
0
    GameObject GetRandomRoom(Spire spire)
    {
        int getRoomIndex = Random.Range(0, spire.rooms.Count);

        while (getRoomIndex == lastRoomIndex || getRoomIndex == 0)
        {
            getRoomIndex = Random.Range(0, spire.rooms.Count);
        }
        lastRoomIndex = getRoomIndex;

        if (isFirst)
        {
            isFirst       = false;
            lastRoomIndex = 0;
            return(spire.rooms [0]);
        }



        return(spire.rooms [getRoomIndex]);
    }
Exemple #6
0
		private void cellExport1_GetDataParams(object sender, Spire.DataExport.EventArgs.DataParamsEventArgs e)
		{
			if 	((e.Sheet == 0) && (e.Col == 6))
			{
				e.FormatText = cellExport1.DataFormats.Currency;
			}
		}
Exemple #7
0
        private string _parCheck(Spire.Doc.Documents.Paragraph p)
        {
            string comment = " Измените колонтитулы: ";
            comment += "расположение " + info.num_location;
            comment += NumFontCheck(p);

            return comment;
        }
Exemple #8
0
 private DocumentFormat.OpenXml.Wordprocessing.Paragraph ReturnFirstInSect(Spire.Doc.Section sectPr)
 {
     Spire.Doc.Documents.Paragraph f_par = sectPr.Paragraphs[0];
     int index = IndexOfPar(f_par);
     DocumentFormat.OpenXml.Wordprocessing.Paragraph parXML = document.MainDocumentPart.Document.Descendants<DocumentFormat.OpenXml.Wordprocessing.Paragraph>().ToList().ElementAt(index);
     return parXML;
 }
Exemple #9
0
 // проверка нумерации страниц
 private void NumPagesCheck(Spire.Doc.Section s)
 {
     string comment = "";
     if (s.HeadersFooters.Footer != null)
     {
        foreach (Spire.Doc.Documents.Paragraph p in s.HeadersFooters.Footer.Paragraphs)
        {
            comment += _parCheck(p);
        }
     }
     if (s.HeadersFooters.Header != null)
     {
         foreach (Spire.Doc.Documents.Paragraph p in s.HeadersFooters.Header.Paragraphs)
         {
             comment += _parCheck(p);
         }
     }
     if(comment!="")
         AddCommentOnParagraph(ReturnFirstInSect(s), comment);
 }
Exemple #10
0
        // проверка шрифта
        private string NumFontCheck(Spire.Doc.Documents.Paragraph docXpar)
        {
            string com = "";
            // шрифт
            if (info.num_font_title != docXpar.BreakCharacterFormat.FontName)
                com += "; " + "название шрифта - " + info.num_font_title;
            if (info.num_size != docXpar.BreakCharacterFormat.FontSize)
                com += "; " + "размер шрифта - " + info.num_size.ToString();
            if (info.num_color == "черный")
            {
                if (docXpar.BreakCharacterFormat.TextColor.Name != "0")
                    com += "; " + "цвет - " + info.num_color;
            }
            else if (info.num_color == "красный")
            {
                if (docXpar.BreakCharacterFormat.TextColor.Name != "ffff0000")
                    com += "; " + "цвет - " + info.num_color;
            }
            else if (info.num_color == "серый")
            {
                if (docXpar.BreakCharacterFormat.TextColor.Name != "ffa5a5a5")
                    com += "; " + "цвет - " + info.num_color;
            }
            else if (info.num_color == "синий")
            {
                if (docXpar.BreakCharacterFormat.TextColor.Name != "ff2e74b5")
                    com += "; " + "цвет - " + info.num_color;
            }
            if (info.num_bold != docXpar.BreakCharacterFormat.Bold)
                com += "; " + "полужирный - " + info.num_bold.ToString();
            if (info.num_italic != docXpar.BreakCharacterFormat.Italic)
                com += "; " + "курсив - " + info.num_italic.ToString();

            bool line;
            if (docXpar.BreakCharacterFormat.UnderlineStyle != Spire.Doc.Documents.UnderlineStyle.None)
                line = true;
            else line = false;

            if (info.num_underlined != line)
                com += "; " + "подчеркнутый - " + info.num_underlined;
            return com;
        }
Exemple #11
0
        // проверка полей
        private void MarginCheck(Spire.Doc.Section sectPr)
        {
            string comment = "Требуется изменить поля: ";
            var top = sectPr.PageSetup.Margins.Top;
            var bottom = sectPr.PageSetup.Margins.Bottom;
            var left = sectPr.PageSetup.Margins.Left;
            var right = sectPr.PageSetup.Margins.Right;
            double l_mar = Math.Round((iTextSharp.text.Utilities.PointsToMillimeters(left) / 10), 2, MidpointRounding.AwayFromZero);
            double r_mar = Math.Round((iTextSharp.text.Utilities.PointsToMillimeters(right) / 10), 2, MidpointRounding.AwayFromZero);
            double t_mar = Math.Round((iTextSharp.text.Utilities.PointsToMillimeters(top) / 10), 2, MidpointRounding.AwayFromZero);
            double b_mar = Math.Round((iTextSharp.text.Utilities.PointsToMillimeters(bottom) / 10), 2, MidpointRounding.AwayFromZero);
            if (l_mar != info.left_field)
                comment += "левое поле " + info.left_field.ToString() + "; ";
            if (r_mar != info.right_field)
                comment += "правое поле " + info.right_field.ToString() + "; ";
            if (t_mar != info.up_field)
                comment += "верхнее поле " + info.up_field.ToString() + "; ";
            if (b_mar != info.bot_field)
                comment += "нижнее поле " + info.bot_field.ToString() + ".";

            if (l_mar != info.left_field || r_mar != info.right_field || t_mar != info.up_field || b_mar != info.bot_field)
                AddCommentOnParagraph(ReturnFirstInSect(sectPr), comment);
        }
Exemple #12
0
 // нахождение индекса абзаца для проверки
 private int IndexOfPar(Spire.Doc.Documents.Paragraph p)
 {
     return ReturnNumberOfPars().IndexOf(p);
 }
Exemple #13
0
 // проверка колонтитулов
 private void HeaderFooterCheck(Spire.Doc.Section s)
 {
     string comment = "Требуется изменить колонтитулы: ";
     double header_size = Math.Round((iTextSharp.text.Utilities.PointsToMillimeters(s.PageSetup.HeaderDistance) / 10), 2, MidpointRounding.AwayFromZero);
     double footer_size = Math.Round((iTextSharp.text.Utilities.PointsToMillimeters(s.PageSetup.FooterDistance) / 10), 2, MidpointRounding.AwayFromZero);
     if (header_size != info.up_size_colont)
         comment += "верхний колонтитул " + info.up_size_colont.ToString() + "; ";
     if (footer_size != info.bottom_size_colont)
         comment += "нижний колонтитул " + info.bottom_size_colont.ToString() + ".";
     if (header_size != info.up_size_colont || footer_size != info.bottom_size_colont)
         AddCommentOnParagraph(ReturnFirstInSect(s), comment);
 }
Exemple #14
0
        public void PaperFormatOrientCheck(Spire.Doc.Section s)
        {
            string comment = "";

            var width = Math.Round((iTextSharp.text.Utilities.PointsToMillimeters(s.PageSetup.PageSize.Width)), 0, MidpointRounding.AwayFromZero);
            var heigth = Math.Round((iTextSharp.text.Utilities.PointsToMillimeters(s.PageSetup.PageSize.Height)), 0, MidpointRounding.AwayFromZero);

            if (info.orientation == "Книжная")
                if (s.PageSetup.Orientation != PageOrientation.Portrait)
                {
                    comment = "Необходимо изменить ориентацию страницы на книжную.";
                }
            if (info.orientation == "Альбомная")
                if (s.PageSetup.Orientation != PageOrientation.Landscape)
                {
                    comment = "Необходимо изменить ориентацию страницы на альбомную.";
                }
            if (width != info.paper_format_width || heigth != info.paper_format_heigth)
            {
                comment += "Необходимо выбрать формат бумаги " + info.paper_format_value;
                AddCommentOnParagraph(ReturnFirstInSect(s), comment);
            }
        }
Exemple #15
0
        // проверка свойств стиля
        public string CheckStyleProps(int index, StyleDesc styleForCheck, Spire.Doc.Documents.Paragraph docXpar)
        {
            string style_com = "Измените настройки стиля '" + styleForCheck.style_title + "' следующим образом: ";

            // выравни
            if (styleForCheck.align == "по левому краю")
            {
                if (docXpar.Format.HorizontalAlignment != Spire.Doc.Documents.HorizontalAlignment.Left)
                    style_com += "Выравнивание по левому краю; ";
            }
            else if (styleForCheck.align == "по правому краю")
            {
                if (docXpar.Format.HorizontalAlignment != Spire.Doc.Documents.HorizontalAlignment.Right)
                    style_com += "выравнивание по правому краю; ";
            }
            else if (styleForCheck.align == "по центру")
            {
                if (docXpar.Format.HorizontalAlignment != Spire.Doc.Documents.HorizontalAlignment.Center)
                    style_com += "выравнивание по центру; ";
            }
            else if (styleForCheck.align == "по ширине")
            {
                if (docXpar.Format.HorizontalAlignment != Spire.Doc.Documents.HorizontalAlignment.Justify)
                    style_com += "выравнивание по ширине; ";
            }
            // отступы
            if (styleForCheck.indent_1st_string != Math.Round((iTextSharp.text.Utilities.PointsToMillimeters(docXpar.Format.FirstLineIndent) / 10), 2, MidpointRounding.AwayFromZero))
                style_com += "отступ первой строки - " + styleForCheck.indent_1st_string.ToString();

            if (styleForCheck.right_indent != Math.Round((iTextSharp.text.Utilities.PointsToMillimeters(docXpar.Format.RightIndent) / 10), 2, MidpointRounding.AwayFromZero))
                style_com += "; " + "отступ справа - " + styleForCheck.right_indent.ToString();

            if (styleForCheck.left_indent != Math.Round((iTextSharp.text.Utilities.PointsToMillimeters(docXpar.Format.LeftIndent) / 10), 2, MidpointRounding.AwayFromZero))
                style_com += "; " + "отступ слева - " + styleForCheck.left_indent.ToString();

            // интервалы
            if (styleForCheck.interval_before != docXpar.Format.BeforeSpacing)
                style_com += "; " +  "интервал перед абзацем - " + styleForCheck.interval_before.ToString();

            if (styleForCheck.interval_after != docXpar.Format.AfterSpacing)
                style_com += "; " + "интервал после абзаца - " + styleForCheck.interval_after.ToString();

            if (styleForCheck.interval_between != docXpar.Format.LineSpacing)
                style_com += "; " + "междустрочный интервал - " + styleForCheck.interval_between.ToString();
            style_com += FontCheck(styleForCheck, docXpar);

            return style_com;
        }
Exemple #16
0
 GameObject GetStair(Spire spire)
 {
     return(spire.stair);
 }