示例#1
0
 public void Test_Division_and_ChargeGroup_Fess()
 {
     List<Point> points = new List<Point> {new Point(0F,0F), new Point(100F,10F), new Point(10F,100F)};
       Polygon testPoly = new Polygon(points, 100F, 100F, 0F, 0F);
       Division div = new Division(testPoly);
       Field fFess = new Field("solid", new string[] {"argent"});
       Field fShield = new Field("solid", new string[] {"gules"});
       div.field = fShield;
       ChargeGroup cg = new ChargeGroup(div, "fess", 1, fFess);
       div.chargeGroups.Add(cg);
       Assert.Equal(4, div.chargeGroups[0].chargeDivs[0].shape.vertices.Count);
 }
示例#2
0
 public Division[] ExecuteCommand(List<string> command, string commandType)
 {
     if(commandType=="tincture")
       {
     if(command[0]=="ermine" || (command[0]=="vair" || command[0]=="potent"))
     {
       _field = new Field("fur", command.ToArray());
     }
     else
     {
       _field = new Field("solid", command.ToArray());
     }
       }
       if(commandType=="charge")
       {
     ChargeGroup cg = new ChargeGroup(this, command[1], Int32.Parse(command[0]));
     _chargeGroups.Add(cg);
     return cg.chargeDivs;
       }
       if(commandType=="division")
       {
     string divType;
     if(command[0]=="quarterly")
     {
       divType = "quarterly";
     }
     else
     {
       divType = command[1];
     }
     List<Polygon> shapes = this.shape.PartyPer(divType);
     _subdivisions = new Division[shapes.Count];
     for(int i=0; i<shapes.Count; i++)
     {
       _subdivisions[i] = new Division(shapes[i]);
     }
     return _subdivisions;
       }
       return new Division[] {};
 }