Ejemplo n.º 1
0
        private void CheckCommand()
        {
            try {
                string command = Page.Request.Form["sabotage"];

                if (command == null || command == "")
                {
                    return;
                }

                Planet target = Target;

                Sabotage sabotage = Sabotage.GetSabotage(command);
                Result   result   = sabotage.CanSabotage(Source, target);
                report.ResultSet = result;

                if (result.Ok)
                {
                    sabotage.PrepareSabotage(Source, target);
                }

                Log.log("----------SABOTAGE----------------");
                Log.log(result.log());
            } catch (Exception ex) {
                Log.log(ex);
            }
        }
Ejemplo n.º 2
0
 private void WriteItems(HtmlTextWriter writer)
 {
     foreach (SabotageFactory factory in Sabotage.Factories.Values)
     {
         Sabotage sabotage    = (Sabotage)factory.create(null);
         bool     canSabotage = sabotage.CanSabotage(Source, Source).Ok;
         writer.WriteLine("<tr onmouseover='overResource(this);' onmouseout='outResource(this);'>");
         writer.WriteLine("<td class='resource'>{0}</td>", CultureModule.getContent(sabotage.Key));
         writer.WriteLine("<td class='resourceCell'>{0}</td>", sabotage.Turns);
         writer.WriteLine("<td class='resourceCell'>{0}</td>", sabotage.Spies);
         writer.WriteLine("<td class='resourceCell'><a href='javascript:performSabotage(\"{1}\");'><img src='{0}' /></a></td>", OrionGlobals.YesNoImage(canSabotage), sabotage.Key);
         writer.WriteLine("</tr>");
     }
 }