public void Clear() { isOccupied = false; idStored = -1; if (boxLockedAt != null) { boxLockedAt.SetFree(); boxLockedAt =null; } }
public void Clear() { isOccupied = false; idStored = -1; if (boxLockedAt != null) { boxLockedAt.SetFree(); boxLockedAt = null; } }
int GetTouchedBeacon(PatternBox box) { for (int i = 0;i< this.beacons.Count; i++) { var dis = beacons[i].transform.position - box.transform.position; if(dis.sqrMagnitude < BEACON_ACTIVE_DISTANCE_SQRT ){ return i; } } return -1; }
int GetTouchedBeacon(PatternBox box) { for (int i = 0; i < this.beacons.Count; i++) { var dis = beacons[i].transform.position - box.transform.position; if (dis.sqrMagnitude < BEACON_ACTIVE_DISTANCE_SQRT) { return(i); } } return(-1); }
void BoxTouchedBeacon(PatternBox box, PatternBeacon beacon) { if (beacon == null) { box.SetFree (); } else { if(box.State == PatternBox.KState.LOCKED) box.beaconLockedAt.Clear(); beacon.Clear(); box.SetLock(beacon); beacon.Lock(box); } }
bool UpdateWaitingForInput() { if (!Input.GetMouseButtonDown(0)) { return(false); } boxSelected = GetCollidedBox(); //boxSelectedPositionInit = boxSelected.transform.position; if (boxSelected == null) { return(false); } meState = KState.Processing; return(true); }
private void PatternBox_Click(object sender, EventArgs e) { var loc = ((MouseEventArgs)e).Location; PatternSelectedTile = GetCurrentPattern().GetTile( loc.X / CELL_SIZE, loc.Y / CELL_SIZE ); IsChangingPattern = true; PatternDirectionsPanel.Enabled = true; PatternSelectedTile.Directions = GetPatternDirections(); RefreshPatternButtons(PatternSelectedTile); IsChangingPattern = false; PatternBox.Invalidate(); }
void BoxTouchedBeacon(PatternBox box, PatternBeacon beacon) { if (beacon == null) { box.SetFree(); } else { if (box.State == PatternBox.KState.LOCKED) { box.beaconLockedAt.Clear(); } beacon.Clear(); box.SetLock(beacon); beacon.Lock(box); } }
private void DeletePatternButton_Click(object sender, EventArgs e) { if (PatternBox.SelectedItem == null) { return; } patternDic.Remove((string)PatternBox.SelectedItem); PatternBox.Items.Remove(PatternBox.SelectedItem); PatternBox.SelectedItem = null; PatternBox.Update(); PatternBox.Refresh(); patternCounter--; patternCounterLabel.Text = "Pattern count: " + patternCounter; // Reset weights and retrain weights = new double[gridSize, gridSize]; Train(); }
public void Lock(PatternBox box) { boxLockedAt = box; isOccupied = true; idStored = box.id; }
bool UpdateWaitingForInput() { if(!Input.GetMouseButtonDown(0) ) return false; boxSelected = GetCollidedBox(); //boxSelectedPositionInit = boxSelected.transform.position; if(boxSelected == null) return false; meState = KState.Processing; return true; }