# Event Import Quick Reference

## TL;DR - What You Need to Know

**Your existing code still works!** The event system has been reorganized, but all old imports continue to function.

## Current Import Patterns (All Work)

### Pattern 1: Import from main events package (RECOMMENDED)
```python
from events import learnedWalk, firstCrush, christmas
from events import messageFunction, questionFunction
```

### Pattern 2: Import from old files (DEPRECATED but functional)
```python
from events import learnedWalk  # Shows deprecation warning
from dayEvents import christmas  # Shows deprecation warning
```

### Pattern 3: Import from specific categories (ADVANCED)
```python
from events.childhood import learnedWalk, learnedBike
from events.adolescence import firstCrush, firstKiss
from events.holidays import christmas, birthday
```

## Event Location Reference

### Childhood Events (ages 0-12)
```python
from events.childhood.milestones import (
    learnedWalk,
    lostFirstTooth,
    lostLastTooth,
    childLearnedWalk
)

from events.childhood.activities import (
    learnedBike,
    learnedSwim,
    childhoodActivity,
    learnInstrument,
    playDate
)
```

### Adolescence Events (ages 10-18)
```python
from events.adolescence.puberty import (
    puberty,
    startedPeriod,
    braces,
    glasses
)

from events.adolescence.social import (
    firstCrush,
    firstKiss,
    dating_choice,
    romanticDate,
    newFriend
)
```

### Education Events (ages 5-22)
```python
from events.education.school_life import (
    likeSchool,
    dropBooks,
    fieldTrip,
    vendingMachine,
    schoolAssembly,
    schoolFight,
    schoolLunch,
    forgotCombo,
    latetoSchool,
    tiredinClass
)

from events.education.tests import (
    actTest,
    actTestTake,
    satTest
)

from events.education.activities import (
    extracurricular,
    collegeExtracurricular,
    chooseMajor,
    chooseCollege
)
```

### Adulthood Events (ages 18+)
```python
from events.adulthood.career import (
    firstJob,
    jobApplication,
    employeeOfTheMonth,
    openbankAccount
)

from events.adulthood.romance import (
    marriage,
    wedding
)

from events.adulthood.family import (
    haveChild,
    pregnant,
    childBorn
)
```

### Holiday Events
```python
from events.holidays import (
    christmas,
    newYear,
    thanksgiving,
    blackfriday,
    independenceday,
    birthday,
    immunizations,
    vacation,
    newFood
)
```

### School Year Events
```python
from events.school_year import (
    school,
    graduate5th,
    graduate8th,
    graduate12th,
    college,
    collegeParty,
    collegeGreekLife,
    collegeMissHome,
    adultMissFriends,
    collegeMinor,
    driversLessons,
    driversTest,
    positiveInteraction,
    lowEnergyEvents,
    extendedFamily,
    murderAttempt,
    funeral
)
```

### Health Events
```python
from events.health import (
    minorInjury,
    minorSickness,
    breakArm,
    healthCondition,
    lowEnergyEvent,
    negativeHabitEvent
)
```

### Random Events
```python
from events.random import (
    foundAPenny,
    freeConcert,
    carCrash,
    oneTimeEventTest,
    lowAffinity
)
```

### Dilemmas
```python
from events.dilemmas import (
    braceletDilemma,
    bullyDilemma
)
```

### Conversations
```python
from events.conversations import (
    conversationObj,
    conversationInit,
    activity,
    checkIn,
    askAboutDay,
    flatter,
    studySession,
    chat,
    sendCharacterMessage,
    getOpenAIResponse
)
```

### Tutorial
```python
from events.tutorial import (
    firstConversation,
    firstActivityChoice,
    tutorialComplete,
    is_tutorial_mode,
    apply_tutorial_modifiers
)
```

## Base Event Classes
```python
from events.base import (
    questionEvent,
    messageEvent,
    timeEvent,
    dilemmaClass,
    answerOption,
    messageFunction,
    questionFunction
)

# Or just import from main package
from events import messageFunction, questionFunction, answerOption
```

## Migration Examples

### Before (Old Pattern)
```python
from events import learnedWalk, firstCrush, actTest
from dayEvents import christmas, school, birthday

def my_function():
    event = questionFunction('myEvent', 'My message', player, True)
```

### After (Recommended Pattern)
```python
from events import learnedWalk, firstCrush, actTest
from events import christmas, school, birthday
from events import questionFunction

def my_function():
    event = questionFunction('myEvent', 'My message', player, True)
```

### After (Category-Specific Pattern)
```python
from events.childhood import learnedWalk
from events.adolescence import firstCrush
from events.education import actTest
from events.holidays import christmas, birthday
from events.school_year import school
from events.base import questionFunction

def my_function():
    event = questionFunction('myEvent', 'My message', player, True)
```

## Finding Events by Life Stage

**Need an event for a specific age?** Here's where to look:

- **Ages 0-5**: `events.childhood.milestones`, `events.holidays`
- **Ages 6-12**: `events.childhood`, `events.education.school_life`
- **Ages 13-18**: `events.adolescence`, `events.education`
- **Ages 18+**: `events.adulthood`, `events.school_year` (college)
- **Any age**: `events.health`, `events.random`, `events.holidays`

## Common Scenarios

### Adding a new childhood event
```python
# File: events/childhood/milestones.py
from events.base import messageFunction

def myNewEvent(player, type='message'):
    fname = 'myNewEvent'
    check = fname not in player.events and player.c.ageYears == 5
    message = "Something happened!"
    return messageFunction(fname, message, player, check)
```

### Adding a new question event
```python
# File: events/education/school_life.py
from events.base import questionFunction, answerOption

def myQuestionEvent(player, type='message', message=False, response=False):
    fname = 'myQuestionEvent'
    check = fname not in player.askedQuestions
    message = "What do you choose?"
    answerOptions = [
        answerOption('Option 1', energyCost=5),
        answerOption('Option 2', moneyCost=10)
    ]

    if type != 'answer':
        return questionFunction(fname, message, player, check, answerOptions)
    elif type == 'answer':
        # Handle the answer
        if response['option'] == 'Option 1':
            player.messageQueue.append("You chose option 1!")
```

## FAQs

**Q: Do I need to update my existing code?**
A: No, all existing imports continue to work. Update at your own pace.

**Q: What's the benefit of using category-specific imports?**
A: Better code organization and clearer intent. It's easier to see which categories of events a module uses.

**Q: Can I mix import patterns?**
A: Yes! Use whichever pattern makes sense for your code.

**Q: Where should new events go?**
A: Choose the category that best matches the event's purpose:
- **Life stage**: childhood, adolescence, adulthood
- **Context**: education, health, holidays
- **Type**: random, dilemmas

**Q: What if an event fits multiple categories?**
A: Put it in the most specific category. For example, a school health event goes in `education` rather than `health`.

**Q: Will the old files be removed?**
A: Not immediately. They'll remain for backward compatibility for at least a few months.

## Getting Help

- See `EVENT_REFACTORING_SUMMARY.md` for complete details
- See `EVENT_SYSTEM_GUIDE.md` for event system documentation
- Check the source code in `ws/events/` for examples
