<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Prism.API.Audio;
using Prism.Debugging;
using Prism.Mods;
using Prism.Mods.DefHandlers;
using Prism.Mods.Hooks;
using Prism.Util;
using Terraria;
using Terraria.IO;

namespace Prism
{
    public sealed class TMain : Main
    {
        internal static Texture2D WhitePixel;
        /// <summary>
        /// The amount of time elapsed since the previous frame (in seconds).
        /// </summary>
        public static float ElapsedTime
        {
            get;
            private set;
        }

        static bool justDrawCrashed = false;
        static Exception lastDrawExn = null;

        static bool prevGameMenu = true;

        internal TMain()
        : base()
        {
            versionNumber += ", " + PrismApi.NiceVersionString;

            SavePath += "\\Prism";

            PlayerPath = SavePath + "\\Players";
            WorldPath = SavePath + "\\Worlds";

            PrismApi.ModDirectory = SavePath + "\\Mods";

            CloudPlayerPath = "players_Prism";
            CloudWorldPath = "worlds_Prism";

            LocalFavoriteData = new FavoritesFile(SavePath + "\\favorites.json", false);
            CloudFavoritesData = new FavoritesFile("/favorites_Prism.json", false);

            Configuration = new Preferences(SavePath + "\\config.json", false, false);

            ElapsedTime = 0;
        }

        static void HookWrappedMethods()
        {
            P_OnUpdateMusic += Bgm.Update;

#pragma warning disable 618
            P_OnPlaySound_Int32_Int32_Int32_Int32 += (t, x, y, s) => Sfx.Play(t, x, y, s);
#pragma warning restore 618

            Item      .P_OnSetDefaultsById   += ItemDefHandler.OnSetDefaults      ;
            Item      .P_OnSetDefaultsByName += ItemDefHandler.OnSetDefaultsByName;
            NPC       .P_OnSetDefaultsById   += NpcDefHandler .OnSetDefaults      ;
            NPC       .P_OnSetDefaultsByName += NpcDefHandler .OnSetDefaultsByName;
            Projectile.P_OnSetDefaults       += ProjDefHandler.OnSetDefaults      ;

            NPC.P_OnNewNPC += NpcHooks.OnNewNPC;
            NPC.P_OnAI     += NpcHooks.OnAI;
        }

        protected override void Initialize()<commit_msg>might be a better idea<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Prism.API.Audio;
using Prism.Debugging;
using Prism.Mods;
using Prism.Mods.DefHandlers;
using Prism.Mods.Hooks;
using Prism.Util;
using Terraria;
using Terraria.IO;

namespace Prism
{
    public sealed class TMain : Main
    {
        internal static Texture2D WhitePixel;
        /// <summary>
        /// The amount of time elapsed since the previous frame (in seconds).
        /// </summary>
        public static float ElapsedTime
        {
            get;
            private set;
        }

        static bool justDrawCrashed = false;
        static Exception lastDrawExn = null;

        static bool prevGameMenu = true;

        internal TMain()
        : base()
        {
            versionNumber += ", " + PrismApi.NiceVersionString;

            SavePath += "\\Prism";

            PlayerPath = SavePath + "\\Players";
            WorldPath = SavePath + "\\Worlds";

            PrismApi.ModDirectory = SavePath + "\\Mods";

            CloudPlayerPath = "players_Prism";
            CloudWorldPath = "worlds_Prism";

            LocalFavoriteData = new FavoritesFile(SavePath + "\\favorites.json", false);
            CloudFavoritesData = new FavoritesFile("/favorites_Prism.json", false);

            Configuration = new Preferences(SavePath + "\\config.json", false, false);

            ElapsedTime = 0;
        }

        static void HookWrappedMethods()
        {
            P_OnUpdateMusic += Bgm.Update;

#pragma warning disable 618
            P_OnPlaySound_Int32_Int32_Int32_Int32 += (t, x, y, s) => Sfx.Play(t, new Vector2(x, y), s);
#pragma warning restore 618

            Item      .P_OnSetDefaultsById   += ItemDefHandler.OnSetDefaults      ;
            Item      .P_OnSetDefaultsByName += ItemDefHandler.OnSetDefaultsByName;
            NPC       .P_OnSetDefaultsById   += NpcDefHandler .OnSetDefaults      ;
            NPC       .P_OnSetDefaultsByName += NpcDefHandler .OnSetDefaultsByName;
            Projectile.P_OnSetDefaults       += ProjDefHandler.OnSetDefaults      ;

            NPC.P_OnNewNPC += NpcHooks.OnNewNPC;
            NPC.P_OnAI     += NpcHooks.OnAI;
        }

        protected override void Initialize()
{'fraction_non_alphanumeric': 0.09266409266409266, 'fraction_numerical': 0.007078507078507079, 'mean_word_length': 2.1169786096256686, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1013394', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1314, 'n_words': 308}