Beispiel #1
0
 private void writeInfluence(FileStream fs, Influence inf)
 {
     write(fs, inf.Name);
     int color = inf.Color.ToArgb();
     write(fs, color);
 }
Beispiel #2
0
 private void addInfluenceToSelectedRegions(Influence influence)
 {
     foreach (Region region in influence.GetRegions())
     {
         addSelectedRegion(region);
     }
 }
Beispiel #3
0
 private Influence readInfluence(FileStream fs)
 {
     Influence inf = new Influence();
     inf.Name = readString(fs);
     inf.Color = Color.FromArgb(readInt(fs));
     return inf;
 }
Beispiel #4
0
 public void SelectCurInfluence(int x, int y)
 {
     Influence inf = translateToInfluence(x, y);
     if (inf != null)
     {
         if (curInfluence == inf)
         {
             curInfluence = null;
         }
         else
         {
             curInfluence = inf;
         }
     }
 }
Beispiel #5
0
 public void NewSelectedInfluence()
 {
     if (selectedRegions.Count > 0)
     {
         Influence newInfluence = new Influence();
         int argb = new Random().Next();
         newInfluence.Color = Color.FromArgb((int)(argb|0XFF000000)); ;
         foreach (Region region in selectedRegions)
         {
             newInfluence.AddRegion(region);
             if (region.Influence != null)
             {
                 region.Influence.RemoveRegion(region);
             }
             region.Influence = newInfluence;
         }
         selectedRegions.Clear();
     }
 }
Beispiel #6
0
 public void drawInfluence(Graphics g, Influence inf)
 {
     if (inf != null && inf.GetRegions().Count > 0)
     {
         foreach (Region region in inf.GetRegions())
         {
             drawRegion(g, region);
         }
     }
 }
Beispiel #7
0
 public void CancelCurInfluence()
 {
     curInfluence = null;
 }
Beispiel #8
0
 private void removeInfluenceFromSelectedRegions(Influence influence)
 {
     foreach (Region region in influence.GetRegions())
     {
         removeSelectedRegion(region);
     }
 }