protected int MerchantCalculation(MovingCommand command) { if (command.GetType() == typeof(Return)) return ((Return)command).Merchant; beans.SendResource sendResource = (beans.SendResource)command; return (sendResource.Wood + sendResource.Clay + sendResource.Iron) / 1000 + ((sendResource.Wood + sendResource.Clay + sendResource.Iron) % 1000 > 0 ? 1 : 0); }
protected string DisplayResources(MovingCommand command) { if (command.GetType() != typeof(beans.SendResource)) return ""; if (command.FromVillage.Player.ID != (int)Session["user"]) return ""; beans.SendResource sendResource = (beans.SendResource)command; string result = ""; if (sendResource.Wood>0) result += String.Format("<img src=\"images\\holz.png\" /> {0}", sendResource.Wood); if (sendResource.Clay > 0) result += String.Format("<img src=\"images\\lehm.png\" /> {0}", sendResource.Clay); if (sendResource.Iron > 0) result += String.Format("<img src=\"images\\eisen.png\" /> {0}", sendResource.Iron); return result; }