a
    S+i<}  ã                   @   sÜ   d Z ddlZddlZG dd„ dƒZG dd„ dƒZG dd„ dƒZG d	d
„ d
ƒZG dd„ dƒZG dd„ dƒZdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd „ Zd!d"„ Zd#d$„ Zd%d&„ Zd'd(„ Zd)d*„ ZdS )+a†  
Education Management Module for BaoLife

This module contains all education-related classes and functions including:
- School classes (Elementary, High School, College)
- Education record management
- Focus and extracurricular activities
- College major definitions

Classes:
    - ElementarySchoolClass: Elementary school location class
    - HighSchoolClass: High school location class
    - CollegeClass: College/university location class
    - CollegeMajorClass: College major definitions
    - FocusClass: Focus types for activities (Work Hard, Slack Off, etc.)
    - ExtraCurricular: Extracurricular activity definitions

Functions:
    - getSchools: Returns lists of elementary and high schools
    - getColleges: Returns list of colleges
    - getMajors: Returns list of college majors
    - getFocuses: Returns list of focus types
    - randomFocus: Returns random focus
    - update_focus: Updates focus for an activity
    - getFocus: Gets focus object by name
    - getExtraCurriculars: Returns list of extracurricular activities
    - randomExtraCurricular: Returns random extracurricular
    - setEducation: Sets up education for a person based on age
    - handleEducation: Handles GPA updates based on focus
    - setExtracurricular: Assigns extracurricular to person
    - applyForExtracurricular: Apply for an extracurricular activity
    - quitExtraCurricular: Quit an extracurricular activity
é    Nc                   @   s   e Zd ZdZddd„ZdS )ÚElementarySchoolClassaÊ  
    Elementary School location class (inherits from locationClass)

    Attributes:
        id: Unique identifier
        type: Location type ('elementary_school')
        title: School name
        public_private: 'Public' or 'Private'
        student_count: Number of students
        teacher_student_ratio: Teacher to student ratio
        description: Generated description
        energyModifier: Energy cost (15)
        image: Optional image URL
    Nc                 C   s~   ddl m} t ¡ j| _| | | j||¡ || _|| _|| _	|| _
d| _d| j d t| j	ƒ d t| j
ƒ d | _d| _d S )	Nr   ©ÚlocationClassÚelementary_schoolúA z elementary school with z) students and a teacher-student ratio of Ú.é   )Úcore.modelsr   ÚuuidÚuuid4ÚhexÚidÚ__init__ÚtitleÚpublic_privateÚstudent_countÚteacher_student_ratioÚtypeÚstrÚdescriptionÚenergyModifier)Úselfr   Úschool_namer   r   r   Úimager   © r   ú</var/www/lichun.app/lichun/ws/education/education_manager.pyr   E   s    ,zElementarySchoolClass.__init__)N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   6   s   r   c                   @   s   e Zd ZdZddd„ZdS )ÚHighSchoolClassaé  
    High School location class (inherits from locationClass)

    Attributes:
        id: Unique identifier
        type: Location type ('high_school')
        title: School name
        public_private: 'Public' or 'Private'
        student_count: Number of students
        teacher_student_ratio: Teacher to student ratio
        GPA_avg: Average GPA at the school
        description: Generated description
        energyModifier: Energy cost (20)
        image: Optional image URL
    Nc           	      C   s’   ddl m} t ¡ j| _| | | j||¡ || _|| _|| _	|| _
|| _d| _d| j d t| j	ƒ d t| j
ƒ d t| jƒ d | _d	| _d S )
Nr   r   Úhigh_schoolr   z high school with z& students, a teacher-student ratio of z, and an average GPA of r   é   )r	   r   r
   r   r   r   r   r   r   r   r   ÚGPA_avgr   r   r   r   )	r   r   r   r   r   r   r$   r   r   r   r   r   r   f   s    :zHighSchoolClass.__init__)Nr   r   r   r   r   r!   V   s   r!   c                   @   s   e Zd ZdZddd„ZdS )ÚCollegeClassa3  
    College/University location class (inherits from locationClass)

    Attributes:
        id: Unique identifier
        type: Location type ('college')
        title: College name
        public_private: 'Public' or 'Private'
        attendance: Number of students
        GPA_req: Required GPA for admission
        ACT_req: Required ACT score for admission
        specialization: Area of focus
        cost: Annual cost of attendance
        description: Generated description
        energyModifier: Energy cost (20)
        image: Optional image URL
    Nc
                 C   sŒ   ddl m}
 t ¡ j| _|
 | | j||	¡ || _|| _|| _	|| _
|| _|| _|| _d| _d| j d | j d t| j	ƒ d | _d| _d S )	Nr   r   Úcolleger   z college with a focus on z. The cost of attendance is $z
 per year.r#   )r	   r   r
   r   r   r   r   r   r   Ú
attendanceÚGPA_reqÚACT_reqÚspecializationÚcostr   r   r   r   )r   r   r   r   r'   r(   r)   r*   r+   r   r   r   r   r   r   Š   s    (zCollegeClass.__init__)Nr   r   r   r   r   r%   x   s   r%   c                   @   s   e Zd ZdZdd„ ZdS )ÚCollegeMajorClasszê
    College Major definition class

    Attributes:
        id: Unique identifier
        title: Major name
        related_jobs: List of job titles related to this major
        colleges: List of college IDs offering this major
    c                 C   s,   t  ¡ j| _|| _|| _dd„ |D ƒ| _d S )Nc                 S   s   g | ]
}|j ‘qS r   )r   )Ú.0r&   r   r   r   Ú
<listcomp>­   ó    z.CollegeMajorClass.__init__.<locals>.<listcomp>)r
   r   r   r   r   Úrelated_jobsÚcolleges)r   r   r0   r1   r   r   r   r   ¨   s    zCollegeMajorClass.__init__Nr   r   r   r   r   r,   ž   s   	r,   c                   @   s   e Zd ZdZdd„ ZdS )Ú
FocusClassaô  
    Focus type for activities (work/study approach)

    Attributes:
        id: Focus ID number
        focus_name: Name of the focus type
        description: Description of the focus
        energyModifier: Energy cost modifier (positive = more energy used)

    Focus Types:
        - Work Hard: +10 energy, improves performance/GPA
        - Slack Off: -10 energy, reduces performance/GPA
        - Socialize: +10 energy, builds relationships
        - Balanced: 0 energy, neutral approach
    c                 C   s   || _ || _|| _|| _d S )N)r   Ú
focus_namer   r   )r   r   r3   r   r   r   r   r   r   À   s    zFocusClass.__init__Nr   r   r   r   r   r2   °   s   r2   c                   @   s   e Zd ZdZddd„ZdS )ÚExtraCurricularaT  
    Extracurricular activity definition

    Attributes:
        id: Unique identifier
        title: Activity name
        type: Activity type ('extracurricular')
        focus: Default focus type for this activity
        description: Description of the activity
        energyModifier: Energy cost
        image: Optional image URL
    Nc                 C   s4   t  ¡ j| _|| _|| _d| _|| _|| _|| _	d S )NÚextracurricular)
r
   r   r   r   r   r   r   Úfocusr   r   )r   r   r6   r   r   r   r   r   r   r   Ô   s    zExtraCurricular.__init__)Nr   r   r   r   r   r4   Ç   s   r4   c               
   C   s<  g } g }|   tddddddƒ¡ |   tdddd	d
dƒ¡ |   tddddddƒ¡ |   tddddddƒ¡ |   tddddddƒ¡ |   tddddddƒ¡ |  tddddddd ƒ¡ |  tdd!dd"d#d$d%ƒ¡ |  tdd&dd'd(d)d*ƒ¡ |  tdd+dd,d-d.d/ƒ¡ |  tdd0dd1d2d3d4ƒ¡ |  tdd5dd6d7d8d9ƒ¡ | |fS ):a‰  
    Generate lists of elementary and high schools

    Returns:
        tuple: (elementary_schools, high_schools) lists

    Elementary Schools (6):
        - Maple Elementary School (Public, 350 students)
        - Eagle Private Academy (Private, 200 students)
        - Greenwood Elementary (Public, 400 students)
        - Bright Stars School (Private, 150 students)
        - Lakeview Elementary (Public, 320 students)
        - Grand Oak Elementary (Public, 500 students)

    High Schools (6):
        - Valley High School (Public, 1200 students, 3.2 GPA avg)
        - Prestige Prep School (Private, 600 students, 3.8 GPA avg)
        - Northview High (Public, 1500 students, 2.8 GPA avg)
        - Academic Excellence Institute (Private, 450 students, 4.0 GPA avg)
        - Harmony High (Public, 1400 students, 3.0 GPA avg)
        - Mountain Ridge High (Public, 1300 students, 3.4 GPA avg)
    Z
ElementaryzMaple Elementary SchoolÚPublici^  r#   zChttps://v3b.fal.media/files/b/lion/CpB2aNqv0hZSAt6LAXMPc_output.pngzEagle Private AcademyÚPrivateéÈ   r   zDhttps://v3b.fal.media/files/b/zebra/5XWdF5HbjNA-9b4ywu4AZ_output.pngzGreenwood Elementaryi  é   zDhttps://v3b.fal.media/files/b/koala/AIsZQawDL7vB7Jknjpo9Y_output.pngzBright Stars Schoolé–   é   zChttps://v3b.fal.media/files/b/lion/Bh0Hd9irvCMROr-p_G-84_output.pngzLakeview Elementaryi@  é   zDhttps://v3b.fal.media/files/b/zebra/IeYo5Q6UCJVUxrgQGLYZL_output.pngzGrand Oak Elementaryiô  é   zGhttps://v3b.fal.media/files/b/kangaroo/NnrqQFCtX_r5TIaqzcicC_output.pngZHighzValley High Schooli°  çš™™™™™	@zDhttps://v3b.fal.media/files/b/zebra/-KUYF_m7ogEpGacZpibpE_output.pngzPrestige Prep SchooliX  é
   gffffff@zDhttps://v3b.fal.media/files/b/zebra/xnj1-iTDaxz9WJEuiovrV_output.pngzNorthview HighiÜ  é   gffffff@zDhttps://v3b.fal.media/files/b/koala/okbmoh_kANj1YeEDdDfso_output.pngzAcademic Excellence InstituteiÂ  é   g      @zDhttps://v3b.fal.media/files/b/tiger/PLKjjZXyeUCPu37Ys-YVx_output.pngzHarmony Highix  é   ç      @zDhttps://v3b.fal.media/files/b/panda/DcGawkSRWjfBC7Vvzg7r__output.pngzMountain Ridge Highi  é   ç333333@zEhttps://v3b.fal.media/files/b/rabbit/MEKUq9oBoHDLVlkyUFaQs_output.png)Úappendr   r!   )Úelementary_schoolsÚhigh_schoolsr   r   r   Ú
getSchoolsâ   s    rJ   c                  C   s4  g } |   tddddddddd	ƒ	¡ |   tdd
dddddddƒ	¡ |   tdddddddddƒ	¡ |   tdddddddddƒ	¡ |   tdddd d!d"d#dd$ƒ	¡ |   tdd%dd&d'd(d)d*dƒ	¡ |   tdd+dd,d-d.d/d d0ƒ	¡ |   tdd1ddd!d2d3d4d5ƒ	¡ |   tdd6ddd7d8d9d:d;ƒ	¡ |   tdd<dd=ddd>d?d@ƒ	¡ | S )AaŸ  
    Generate list of colleges and universities

    Returns:
        list: List of CollegeClass objects

    Colleges (10):
        - University of Science (Public, $10k/yr)
        - Artistic Minds University (Private, $20k/yr)
        - Eastern Commerce College (Public, $8k/yr)
        - Law and Governance University (Private, $25k/yr)
        - Institute of Tech Innovation (Public, $15k/yr)
        - Liberal Arts Academy (Private, $18k/yr)
        - Northern Agriculture College (Public, $12k/yr)
        - Health and Medicine University (Private, $30k/yr)
        - Oceanography Institute (Public, $9k/yr)
        - Performing Arts School (Private, $22k/yr)
    ZCollegezUniversity of Sciencer7   i˜:  g      @rA   zScience and Engineeringi'  zDhttps://v3b.fal.media/files/b/tiger/RZeOANHNvGzGJo63zWZii_output.pngzArtistic Minds Universityr8   ip  r?   rE   zArts and Humanitiesi N  zDhttps://v3b.fal.media/files/b/zebra/3pim3xDjmslzE5G3tmpPB_output.pngzEastern Commerce CollegegÍÌÌÌÌÌ@é   zBusiness and Economicsi@  zEhttps://v3b.fal.media/files/b/monkey/m6iy3jaNX4QQQ1fc8t6uq_output.pngzLaw and Governance UniversityiX  gÍÌÌÌÌÌ@é   zLaw and Politicsi¨a  zGhttps://v3b.fal.media/files/b/kangaroo/xwKoxESWFmglFxTzHryfn_output.pngzInstitute of Tech Innovationià.  gš™™™™™@é   zTechnology and Computer SciencezDhttps://v3b.fal.media/files/b/panda/u6oYxXNtV9YzEW3dj-eu3_output.pngzLiberal Arts Academyi   gffffff
@r>   zLiberal ArtsiPF  zNorthern Agriculture Collegei°6  rD   r:   z%Agriculture and Environmental SciencezEhttps://v3b.fal.media/files/b/rabbit/zaYHyx9Odqx_n3nNmd0NS_output.pngzHealth and Medicine Universityé   zHealth and Medicinei0u  zGhttps://v3b.fal.media/files/b/kangaroo/9ZXtAvZoy1qhbdPU91GqE_output.pngzOceanography InstituterF   é   zMarine Sciencei(#  zEhttps://v3b.fal.media/files/b/monkey/Vn-IR_yaQ9tk2iQzQa5-s_output.pngzPerforming Arts Schooliˆ  zPerforming ArtsiðU  zDhttps://v3b.fal.media/files/b/koala/q8_eoVhSeDNGyCk8kyFzY_output.png)rG   r%   )r1   r   r   r   ÚgetColleges  s    rP   c                 C   s¬  g }|  tddg| d | d gƒ¡ |  tddg| d gƒ¡ |  tdg d	¢| d
 gƒ¡ |  tddg| d gƒ¡ |  tddg| d gƒ¡ |  tddg| d | d gƒ¡ |  tddg| d gƒ¡ |  tddg| d gƒ¡ |  tdddg| d gƒ¡ |  tddg| d | d gƒ¡ |  tdg d¢| d gƒ¡ |  td d!g| d
 gƒ¡ |  td"d#g| d gƒ¡ |  td$d%g| d
 | d gƒ¡ |  td&d'g| d( gƒ¡ |S ))uT  
    Generate list of college majors with associated colleges and careers

    Args:
        colleges (list): List of CollegeClass objects

    Returns:
        list: List of CollegeMajorClass objects

    Majors (15):
        - Computer Science â†’ Software Engineer
        - Nursing â†’ Registered Nurse
        - Education â†’ Teachers, Counselor
        - Criminal Justice â†’ Police Officer
        - Accounting â†’ Accountant
        - Culinary Arts â†’ Chef
        - Law â†’ Lawyer
        - Automotive Technology â†’ Automotive Mechanic
        - Business â†’ Sales Rep, Real Estate Agent
        - Architecture â†’ Architect
        - Medicine â†’ Physician, Dentist, Pharmacist
        - Library Science â†’ Librarian
        - Journalism â†’ Journalist
        - Psychology â†’ Counselor
        - Veterinary Medicine â†’ Veterinarian
    zComputer SciencezSoftware Engineerr   é   ZNursingzRegistered Nurseé   Z	Education)zHigh School TeacherzElementary School TeacherÚ	Counseloré   zCriminal JusticezPolice Officeré   Z
AccountingZ
Accountanté   zCulinary ArtsZChefé   é	   ZLawZLawyerzAutomotive TechnologyzAutomotive MechanicÚBusinesszSales RepresentativezReal Estate AgentZArchitectureZ	ArchitectZMedicine)Z	PhysicianZDentistZ
PharmacistzLibrary ScienceZ	LibrarianZ
JournalismZ
JournalistÚ
PsychologyrS   zVeterinary MedicineZVeterinariané   )rG   r,   )r1   Úmajorsr   r   r   Ú	getMajors3  s"        r]   c                  C   sX   g } |   tddddƒ¡ |   tddddƒ¡ |   td	d
ddƒ¡ |   tddddƒ¡ | S )as  
    Get list of available focus types for activities

    Returns:
        list: List of FocusClass objects

    Focus Types:
        1. Work Hard: +10 energy cost, improves performance/GPA
        2. Slack Off: -10 energy cost, reduces performance/GPA
        3. Socialize: +10 energy cost, builds relationships
        4. Balanced: 0 energy cost, neutral approach
    rW   ú	Work HardzWork hard to get aheadr@   rV   ú	Slack Offz!Slack off at work to avoid stressiöÿÿÿrU   Ú	Socializez,Socialize with others to build relationshipsrQ   ÚBalancedzBalance work and socializingr   )rG   r2   )Úfocusesr   r   r   Ú
getFocusesh  s    rc   c                   C   s   t  tƒ ¡S )zW
    Get a random focus type

    Returns:
        FocusClass: Random focus object
    )ÚrandomÚchoicerc   r   r   r   r   ÚrandomFocus}  s    rf   c                 C   s"   t ƒ D ]}|j| kr|  S qdS )z
    Get focus object by name

    Args:
        focusName (str): Name of the focus type

    Returns:
        FocusClass: Matching focus object or None
    N)rc   r3   )Z	focusNamer6   r   r   r   ÚgetFocus‡  s    



rg   c                 C   s¨   ddl m} | jjD ]†}t|jƒ ¡ t|ƒ ¡ krt|jd | ƒ t	|ƒ}tdt| jj
ƒ d t|jƒ d t| jj
|j ƒ ƒ |j|_|| jƒ  q¤qtdƒ dS )aR  
    Update the focus for a specific activity

    Args:
        player: Player object containing character
        activity_id (str): ID of the activity to update
        new_focus (str): Name of the new focus type

    Updates:
        - Changes the focus in the activity record
        - Recalculates peak energy for the character
    r   )ÚgetPeakEnergyz -> zpeak energy change z + zNo matching activity found.N)Ústats.stats_managerrh   ÚcÚactivityRecordsr   r   ÚstripÚprintr6   rg   Ú
peakEnergyr   r3   )ÚplayerZactivity_idZ	new_focusrh   ZactivityRecordr   r   r   Úupdate_focus—  s    8
rp   c                  C   sÎ   g } |   tdddddƒ¡ |   tdddd	d
ƒ¡ |   tdddddƒ¡ |   tdddddƒ¡ |   tdddddƒ¡ |   tdddddƒ¡ |   tdddd	dƒ¡ |   tdddd	dƒ¡ |   td dd!dd"ƒ¡ | S )#a  
    Get list of available extracurricular activities

    Returns:
        list: List of ExtraCurricular objects

    Activities (9):
        - Choir (Work Hard, 20 energy)
        - Musical Theater (Socialize, 30 energy)
        - Debate Team (Work Hard, 20 energy)
        - Writing Club (Balanced, 10 energy)
        - Robotics Team (Work Hard, 40 energy)
        - Baseball (Socialize, 20 energy)
        - Basketball (Socialize, 30 energy)
        - Soccer (Socialize, 30 energy)
        - Football (Socialize, 40 energy)
    ZChoirr^   z3Perfect your singing skills and perform in concertsr#   a7  https://media.discordapp.net/attachments/1106614533402931284/1122691487180795965/craig_vg_school_choir_class_cute_cartoon_style_ba317c8f-6ed0-4955-84cd-faeeff28ee68.png?ex=6600cb6d&is=65ee566d&hm=4dae9a84443a033d8e62046463f6605ef7d250e83a6333436117c152b9169ece&=&format=png&quality=lossless&width=526&height=526zMusical Theaterr`   z*Perform in musicals and bond with the castrL   a:  https://media.discordapp.net/attachments/1106614533402931284/1122692114644484197/craig_vg_Musical_theater_class_cute_cartoon_style_615a8d72-6c01-445e-b2da-ff0f19ede550.png?ex=6600cc02&is=65ee5702&hm=57b2eddb164479b16e47540ffdadf5f0169d390588d8574db07ef7e0d19fa856&=&format=png&quality=lossless&width=526&height=526zDebate Teamz<Develop your debating skills and compete against other teamsa  https://cdn.discordapp.com/attachments/1106614533402931284/1218745363201134603/craig_vg_debate_team_class_cute_cartoon_style_595c6e7a-b077-47e7-b62c-669464404a69.png?ex=6608c811&is=65f65311&hm=85b9709dcb26d575d301a7f16eaae9cc2795a51ad44f6adc7418b292f77c89ea&zWriting Clubra   z7Improve your writing and share ideas with other membersr@   a>  https://media.discordapp.net/attachments/1106614533402931284/1122923754650079362/craig_vg_writing_club_class_school_cute_cartoon_style_aa1e50e1-3d12-45f1-84df-5e2a743b72b9.png?ex=6601a3be&is=65ef2ebe&hm=cfc45cd684013596ab1d56ea8c0d58ddd12572de3062810a617b02ac400935ab&=&format=png&quality=lossless&width=526&height=526zRobotics Teamz(Design and build robots for competitionsé(   a  https://cdn.discordapp.com/attachments/1106614533402931284/1122923789412483123/craig_vg_robotics_team_school_cute_cartoon_style_892517c3-f69a-4748-8d13-44a91809e392.png?ex=6601a3c6&is=65ef2ec6&hm=17c0fe3680c5df5ba682952ba310ce16ce62e7ae3d98b667abe2074e0611822a&ZBaseballz+Play baseball and spend time with teammateszþhttps://cdn.discordapp.com/attachments/1106614533402931284/1122692176917315595/craig_vg_baseball_team_cute_cartoon_style_941e60c1-1d96-43ef-b6eb-d1e9e3339836.png?ex=6600cc11&is=65ee5711&hm=fdf5b18fb53b4281af65611724565bfd149f63b18d4fa719b91b171ff5d9844c&Z
Basketballz'Play basketball and bond with teammatesa  https://cdn.discordapp.com/attachments/1106614533402931284/1122924183979040798/craig_vg_basketball_team_kids_cute_cartoon_style_4ce4fddf-4520-40ea-97cc-ddecbac6f7e9.png?ex=6601a424&is=65ef2f24&hm=7bc865567e44ca301b6250a29ddba093b16cdff19c4d6924ecfc5c0e3deee2dd&ZSoccerz)Play soccer and spend time with teammatesa  https://cdn.discordapp.com/attachments/1106614533402931284/1122692364624986174/craig_vg_soccer_team_class_cute_cartoon_style_b6f60c0f-36a3-4326-b108-fa7935991cf7.png?ex=6600cc3e&is=65ee573e&hm=a50d45a8bf073dbd1bd0c6005a2781414f87d16d7aa1f60ff2fa0c3eae9139b8&ZFootballz%Play football and bond with teammatesa  https://cdn.discordapp.com/attachments/1106614533402931284/1122924237175394344/craig_vg_american_football_team_cute_cartoon_style_9dc1adfc-bed7-445c-a7d8-333620f0e91f.png?ex=6601a431&is=65ef2f31&hm=4ebd26a3ba5b24a716dab9e108db8ff9fb037b9a38b74e3faca8f1fc754df8e5&)rG   r4   )ÚextraCurricularsr   r   r   ÚgetExtraCurriculars·  s    rs   c                 C   s   t  | j¡S )zÑ
    Get a random extracurricular activity from player's list

    Args:
        player: Player object containing extraCurriculars list

    Returns:
        ExtraCurricular: Random extracurricular object
    )rd   re   rr   )ro   r   r   r   ÚrandomExtraCurricular×  s    
rt   c                 C   sF   ddl m} td|j | ƒ | j |¡ | j ||j|j|ƒ¡ dS )aG  
    Assign an extracurricular activity to a person

    Args:
        person: Person object to assign activity to
        extraCurricularClass: ExtraCurricular object to assign
        date: Date the activity was started

    Updates:
        - Adds activity to person.activities
        - Creates and adds ActivityRecord
    r   )ÚActivityRecordzsetting extracurricularN)	r	   ru   rm   r   Ú
activitiesrG   rk   r   r   )ÚpersonZextraCurricularClassÚdateru   r   r   r   ÚsetExtracurricularä  s    ry   c                 C   sV   ddl m} | jD ]>}|j|krt| j|| jƒ | j d|j	 d ¡ || |ƒ} qdS )a:  
    Apply for an extracurricular activity

    Args:
        player: Player object
        extracurricularID (str): ID of the extracurricular to apply for

    Updates:
        - Assigns extracurricular to player character
        - Creates classmates for the activity
        - Adds message to message queue
    r   )Úcreate_classmateszYou have applied for r   N)
Úcharacter.character_managerrz   rr   r   ry   rj   rx   ÚmessageQueuerG   r   )ro   ZextracurricularIDrz   r5   r   r   r   ÚapplyForExtracurricularù  s    

r}   c                 C   s€   | j D ]t}|j|kr| jjD ]}|j|jkr| jj |¡ q| jjD ]}|j|jkrD| jj |¡ qD| j d|j d ¡ qdS )a@  
    Quit an extracurricular activity

    Args:
        player: Player object
        extraCurricularID (str): ID of the extracurricular to quit

    Updates:
        - Removes activity from player.c.activities
        - Removes activity record from player.c.activityRecords
        - Adds message to message queue
    zYou have quit r   N)	rr   r   rj   rv   Úremoverk   r|   rG   r   )ro   ZextraCurricularIDr5   ÚactivityÚrecordr   r   r   ÚquitExtraCurricular  s    

r   c                 C   s°   t | ddƒr¬t| jƒD ]”\}}|j| jjkrd}| jjdkrBd}n| jjdkrRd}| j|  jt dd| ¡7  _| j| jdkrŽd| j| _| j| jdk rd| j| _qd	S )
aß  
    Update GPA based on focus and intelligence

    This function is called during the game loop to update a student's
    academic performance based on their current focus.

    Args:
        person: Person object with current_education attribute

    Updates:
        - Modifies GPA in the person's education activity record
        - GPA increases more with 'Work Hard' focus
        - GPA decreases more with 'Slack Off' focus
        - GPA is clamped between 0 and 100
    Úcurrent_educationFr   r^   rW   r_   éÿÿÿÿéd   N)	ÚgetattrÚ	enumeraterk   r   r‚   r6   ÚGPArd   Úrandint)rw   ÚindexÚitemZGPA_modifierr   r   r   ÚhandleEducation,  s     r‹   c                 C   s‚  ddl m} d}|jdkr d|_|jdkr0d|_|jdkr@d	|_|jd
krPd|_|jdkr`d|_|jdkrpd|_|jdkr€d|_|jdkrd|_|jdkr d|_|jdkr°d|_|jdkrÀd|_|jdkrÐd|_|jdkràd|_|jdk r
t | j¡|_|j 	|j¡ n(|jdk r2t | j
¡|_|j 	|j¡ t ¡ }|jdkrÖ|dkrÖd |_|jdkrhd!|_|jd"krzd#|_|d$kr¸|jd%kr–d&|_|jd'kr¨d(|_|d)kr¸d*|_t | j¡|_|j 	|j¡ nd+|_|jr||j|j| jd,|_|j 	|j¡ |jr4||j|j| jd,|_|j 	|j¡ |jr`||j|j| jd,|_|j 	|j¡ |jdk r~|jd-kr~d.|_|S )/aª  
    Set up education for a person based on their age

    This function assigns appropriate education level, school, and creates
    education records for a person. Called during character initialization
    and birthdays.

    Args:
        player: Player object containing schools and colleges lists
        person: Person object to set education for

    Updates:
        - Sets person.education (grade level or degree type)
        - Assigns elementary_school, high_school, or college
        - Adds school to person.activities
        - Creates EducationRecord in person.activityRecords
        - Sets person.current_education
        - Sets person.occupation ('student', 'school', or 'work')

    Education Levels by Age:
        5: kindergarten
        6-11: 1st-6th grade (elementary_school)
        12-14: 7th-9th grade (elementary_school)
        15-17: 10th-12th grade (high_school)
        18+: college (60% chance)
            18: college yr 1
            19+: associate_degree (65% chance)
            20: college yr 3 (35% chance of continuing)
            21+: bachelors_degree
            (20% chance): doctorate_degree

    Returns:
        person: Updated person object
    r   )ÚEducationRecordNrT   Úkindergartenr[   Ú1strR   Ú2ndrB   Ú3rdrX   Ú4thr@   Ú5thé   Ú6thr<   Ú7thé   Ú8thé   Ú9thr   Ú10thé   Ú11thé   r"   r=   g333333ã?Úschoolzcollege yr 1é   Zassociate_degreegffffffÖ?r#   zcollege yr 3é   Zbachelors_degreegš™™™™™É?Zdoctorate_degreeÚwork)ÚeducationLevelÚlocationrx   rQ   Ústudent)r	   rŒ   ÚageYearsÚ	educationrd   re   rH   r   rv   rG   rI   r"   Ú
occupationr1   r&   rx   r‚   rk   )ro   rw   rŒ   rž   ZcollegeRatior   r   r   ÚsetEducationL  s~    $














r¨   )r    rd   r
   r   r!   r%   r,   r2   r4   rJ   rP   r]   rc   rf   rg   rp   rs   rt   ry   r}   r   r‹   r¨   r   r   r   r   Ú<module>   s,   " "&-$5
   