예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="source"></param>
 /// <param name="loc"></param>
 /// <param name="ab"></param>
 public void OnClick(MapViewWindow source, Location loc, Point ab)
 {
     if (anchor == Unplaced)
     {
         if (remover)
         {
             if (null == WorldDefinition.World[loc] as HalfDividedVoxel)
             {
                 return;
             }
         }
         else
         {
             if (!HalfVoxelContribution.CanBeBuilt(loc))
             {
                 return;
             }
         }
         anchor                 = loc;
         currentPos             = loc;
         curSide                = getSide(ab);
         sameLevelDisambiguator = new SameLevelDisambiguator(anchor.z);
     }
     else
     {
         if (!currentPos.Equals(anchor))
         {
             OnVoxelSelected(anchor, front, currentSide);
         }
         WorldDefinition.World.OnVoxelUpdated(anchor);
         anchor = Unplaced;
     }
 }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="hvc"></param>
 /// <param name="color"></param>
 /// <param name="hilight"></param>
 /// <param name="front"></param>
 /// <param name="side"></param>
 public ContributionReference(HalfVoxelContribution hvc, int color, int hilight, Direction front, PlaceSide side)
 {
     this.contrib    = hvc;
     this.colorIdx   = color;
     this.hilightIdx = hilight;
     this.placeSide  = side;
     this.frontface  = front;
     this.patternIdx = SpriteSet.GetIndexOf(front, side);
 }
예제 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="contrib"></param>
 /// <param name="site"></param>
 /// <param name="remove"></param>
 public HVControllerImpl(HalfVoxelContribution contrib, IControllerSite site, bool remove)
 {
     this.contrib = contrib;
     this.site    = site;
     this.remover = remove;
 }
예제 #4
0
 public void Add(HalfVoxelContribution contrib)
 {
     arr.Add(contrib);
 }
예제 #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="hvc"></param>
 /// <param name="color"></param>
 /// <param name="hilight"></param>
 /// <param name="front"></param>
 /// <param name="side"></param>
 public EmptyReference(HalfVoxelContribution hvc, int color, int hilight, Direction front, PlaceSide side)
     : base(null, -1, -1, front, side)
 {
 }