示例#1
0
        public override void renderLayout(HtmlTextWriter writer)
        {
            writer.WriteLine("<table align='center' class='frame' width='{0}'>", size);

            //escrever a primeira linha das coordenadas as galxias
            writer.WriteLine("<tr>");
            for (int i = 0; i < Coordinate.MaximumPlanets; ++i)
            {
                writer.WriteLine("<td class='resourceTitle'>{0}</td>", i + 1);
            }
            writer.WriteLine("</tr>");

            //escrever as imagens do Universo
            writer.WriteLine("<tr>");
            for (int i = 1; i <= Coordinate.MaximumPlanets; ++i)
            {
                string coordinate = _sector + ":" + i;
                Planet p          = Universe.instance.getPlanet(Coordinate.translateCoordinate(coordinate));

                string className = chooseClass(p);
                writer.WriteLine(string.Format("<td align='center' class='{0}' width='33%' >", className));

                TravelItem travelItem = new TravelItem(p, string.Format("planetClick({0},this);", i), className == "yours");
                travelItem.RenderControl(writer);

                writer.WriteLine("</td>");
            }
            writer.WriteLine("</tr>");

            writer.WriteLine("</table>");
        }
示例#2
0
        public override void renderLayout(HtmlTextWriter writer)
        {
            writer.WriteLine("<table align='center' class='frame' width='{0}'>",size);

            //escrever a primeira linha das coordenadas as galxias
            writer.WriteLine("<tr>");
            for( int i = 0; i < Coordinate.MaximumPlanets; ++i ) {
                writer.WriteLine("<td class='resourceTitle'>{0}</td>", i+1);
            }
            writer.WriteLine("</tr>");

            //escrever as imagens do Universo
            writer.WriteLine("<tr>");
            for( int i = 1; i <= Coordinate.MaximumPlanets ; ++i ) {

                string coordinate = _sector + ":" + i ;
                Planet p = Universe.instance.getPlanet( Coordinate.translateCoordinate( coordinate ) );

                string className = chooseClass( p );
                writer.WriteLine( string.Format("<td align='center' class='{0}' width='33%' >",className) );

                TravelItem travelItem = new TravelItem( p, string.Format("planetClick({0},this);",i), className=="yours" );
                travelItem.RenderControl( writer );

                writer.WriteLine("</td>");
            }
            writer.WriteLine("</tr>");

            writer.WriteLine("</table>");
        }