private void OnStartInspection(AiEntity e) { if (e.getEntityInfo().IsDoctor) { if (e.getTarget() == null) { e.setTarget(this.getSickEntityInRange(e)); } else { this.doctorCanInspect(e, e.getTarget()); } e.SetPath(_aiSystem.CalulatePathTo(e.GetCurrentTile().GetPosition(), e.getTarget().GetCurrentTile().GetPosition())); e.OnAtTile += instance.OnAtTile; } }
private void OnAtTile(AiEntity e, TileObject t) { // doctor if (e.getEntityInfo().IsDoctor) { if (e.getTarget() == null) { e.setTarget(this.getSickEntityInRange(e)); } else { this.doctorCanInspect(e, e.getTarget()); } if (e.GetCurrentTile().GetPosition() == e.getTarget().GetCurrentTile().GetPosition()) { return; } e.SetPath(_aiSystem.CalulatePathTo(e.GetCurrentTile().GetPosition(), e.getTarget().GetCurrentTile().GetPosition())); } }