public void OnSendStimulus(GameEntity activeEntity, int range, StimulusType stimulusType) { IEnumerable <GameEntity> otherActorsAround = _entityDetector.DetectEntities(activeEntity.position.Position, range) .Where(a => a != activeEntity); foreach (GameEntity receiver in otherActorsAround) { // _stimulusSender.OnSendStimulus(receiver, stimulusDefinition, activeEntity); } }
public Stimulus(StimulusSource source, int sourceAllegiance, StimulusType type, float radius, Vector2 pos, Object handle) { source_ = source; sourceAllegiance_ = sourceAllegiance; type_ = type; radius_ = radius; position_ = pos; handle_ = handle; message_ = null; }
private bool overAudThresh(ref int currVol, TransducerType transducer, StimulusType stimulus, bool OtherChannelInterrupt) { #region Speech Stimulus if (stimulus == StimulusType.Speech) { switch (transducer) { case TransducerType.Bone: if (currVol > 70) { currVol = 70; return true; } break; case TransducerType.Phone: if (currVol > 110) { currVol = 110; return true; } break; case TransducerType.Insert: if (currVol > 115) { currVol = 115; return true; } break; default: break; } return false; } #endregion switch (transducer) { case TransducerType.Bone: switch (ameterSettings.frequency) { #region case 250: case 250: if (currVol > 55) // Bone @ 250 is always 55 { currVol = 55; return true; } break; #endregion #region case 500: case 500: if (OtherChannelInterrupt) { if (currVol > 70) // Bone @ 500 is 70 with interrupt on other channel { currVol = 70; return true; } } else if (currVol > 65) // Bone @ 500 is 65 without interrupt on other channel { currVol = 65; return true; } break; #endregion #region case 1000: case 1000: if (OtherChannelInterrupt) { if (currVol > 80) // Bone & 1000 is 80 with interrupt on other channel { currVol = 80; return true; } } else if (currVol > 75) // etc. See Max_Audiometer_Output spreadsheet { currVol = 75; return true; } break; #endregion #region case 2000: case 2000: if (OtherChannelInterrupt) { if (currVol > 85) { currVol = 85; return true; } } else if (currVol > 80) { currVol = 80; return true; } break; #endregion #region case 4000: case 4000: if (OtherChannelInterrupt) { if (currVol > 90) { currVol = 90; return true; } } else if (currVol > 85) { currVol = 85; return true; } break; #endregion #region case 8000: case 8000: if (OtherChannelInterrupt) { if (currVol > 50) { currVol = 50; return true; } } else if (currVol > 45) { currVol = 45; return true; } break; #endregion #region default: (should never execute) default: // Default to 90 which is the largest bone volume allowed // although, this code should never execute if (currVol > 90) { currVol = 90; return true; } break; #endregion } break; case TransducerType.Insert: switch (ameterSettings.frequency) { #region case 250: case 250: if (OtherChannelInterrupt) { if (currVol > 100) { currVol = 100; break; } } else if (currVol > 90) { currVol = 90; break; } break; #endregion #region case 500: case 500: if (currVol > 110) { currVol = 110; return true; } break; #endregion #region case 1000, 2000, 4000: (same limits) case 1000: case 2000: case 4000: if (currVol > 115) { currVol = 115; return true; } break; #endregion #region case 8000: case 8000: if (OtherChannelInterrupt) { if (currVol > 85) // Check and verify this is correct { // Intuitively, the interrupt should cause the volume // to be greater than the non-interrupt value, so this // may be incorrect... currVol = 85; return true; } } else if (currVol > 90) { currVol = 90; return true; } break; #endregion #region default: (should never execute) default: // Default to 115 which is the largest insert volume allowed // although, this code should never execute if (currVol > 115) { currVol = 115; return true; } break; #endregion } break; case TransducerType.Phone: switch (ameterSettings.frequency) { #region case 250: case 250: if (currVol > 105) { currVol = 105; return true; } break; #endregion #region case 500, 1000, 2000, 4000: (same limits) case 500: case 1000: case 2000: case 4000: if (currVol > 120) { currVol = 120; return true; } break; #endregion #region case 8000: case 8000: if (currVol > 105) { currVol = 105; return true; } break; #endregion #region default: (should never execute) default: // Default to 120 which is the largest phones volume allowed // although, this code should never execute if (currVol > 120) { currVol = 120; return true; } break; #endregion } break; default: if (currVol > 120) { currVol = 120; return true; } break; } return false; }
public Sample(string parse) { this.stimulus = (parse[0].Equals('m')) ? StimulusType.vm : StimulusType.st; this.transformation = int.Parse(parse[1].ToString()); }
public Sample(StimulusType stimulus, int transformation) { this.stimulus = stimulus; this.transformation = transformation; }