/// <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; } }
/// <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); }
/// <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; }
public void Add(HalfVoxelContribution contrib) { arr.Add(contrib); }
/// <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) { }