private void Start() { m_commsPanel = GetComponentInChildren <CommsPanel>(); m_securityPanel = GetComponentInChildren <SecurityPanel>(); m_engineeringPanel = GetComponentInChildren <EngineeringPanel>(); m_flightPanel = transform.GetChild(2).GetComponentInChildren <MapLogic>(); m_startPanel = transform.GetComponentInChildren <StartMenu>(); comsObj = transform.GetChild(1).gameObject; secObj = transform.GetChild(3).gameObject; engObj = transform.GetChild(0).gameObject; flightObj = transform.GetChild(2).gameObject; startMenuObj = transform.GetChild(4).gameObject; gameOverMenuObj = transform.GetChild(5).gameObject; gameWonObj = transform.GetChild(6).gameObject; CloseComs(); CloseSecurity(); CloseEng(); CloseFlight(); CloseStart(); CloseGameOver(); CloseGameWon(); OpenStart(); //GameStateManager.Instance.TargetState = GAME_STATE.Flight; }
void Start() { mapLogic = MapLogic.Instance; playerCharNew = PlayerCharacterNew.Instance; mapLogic.mapDeadSoldierBMWs.Add(this); minLifeTimeCounter = GeneralStats.deadNash_minLifeTime; maxLifeTimeCounter = GeneralStats.deadNash_maxLifeTime; }
} // Unload /////////////////////////////// // Path finding initializing public void LoadMap(MapLogic Logic) { MapWidth = Logic.Width; MapHeight = Logic.Height; //LowX = 0; HighX = MapWidth - 1; //if (HighX<254) { LowX++; HighX+=2; } //LowY = 0; HighY = MapHeight - 1; //if (HighY<254) { LowY++; HighY+=2; } } // LoadMap
public void LoadMap(MapLogic Logic) { int X, Y; int AddrY; //обеспечение непроходимой границы //LowX = 0; HighX = Logic.Width - 1; //if (HighX<254) { LowX++; HighX+=2; } //LowY = 0; HighY = Logic.Height - 1; //if (HighY<254) { LowY++; HighY+=2; } //загрузка проходимости //пока только один слой //**//**//**// AddrY = 0; //CellAddr(0,0); for (Y = 0; Y < Logic.Height; Y++) { for (X = 0; X < Logic.Width; X++) { if (CheckWalkable(X, Y)) { CellCost[0, AddrY + X] = (byte)_Cost0; } else { CellCost[0, AddrY + X] = (byte)_CostBad; } //**//**//**// //if (X==17 && Y==15) // Debug.LogFormat("cell cost: {0},{1} = {2}", X,Y, CellCost[0,CellAddr(X,Y)]); } AddrY += 0x100; } //заполнение непроходимой границы AddrY = 0; for (Y = 0; Y <= HighY; Y++) { CellCost[0, AddrY + 0] = (byte)_CostBad; CellCost[0, AddrY + HighX] = (byte)_CostBad; TargetCost[AddrY + 0] = _CostBad; TargetCost[AddrY + HighX] = _CostBad; AddrY += 0x100; } AddrY = HighY << 8; for (X = 0; X <= HighX; X++) { CellCost[0, 00000 + X] = (byte)_CostBad; CellCost[0, AddrY + X] = (byte)_CostBad; TargetCost[00000 + X] = _CostBad; TargetCost[AddrY + X] = _CostBad; } }
public void ChgScene() { mTestSceneID = mTestSceneID % 3; GameObject mapObj = GameObject.Find("/Scene/map"); if (mapObj != null) { mTestSceneID = mTestSceneID + 1; MapLogic mapScript = mapObj.GetComponent <MapLogic> (); mapScript.ChgMap(mTestSceneID); } }
public virtual void StartIt() { mapLogic = MapLogic.Instance; mapLogic.AddActiveLogicJob(this); //step = 1; SetStep(1); status = LogicJobStatus.Running; //Init_SetControlledSoldier(controlledSoldier); }
// public virtual void Init(Transform contSoldier) { controlledSoldier = contSoldier; soldInfo = controlledSoldier.GetComponent <SoldierInfo>(); charInfo = controlledSoldier.GetComponent <CharacterInfo>(); soldAnimObj = soldInfo.animObject; soldTr = controlledSoldier.transform; soldCharController = controlledSoldier.GetComponent <CharacterController>(); soldCharInfo = controlledSoldier.GetComponent <CharacterInfo>(); mapLogic = soldInfo.mapLogic; playerObj = mapLogic.player; playerCharNew = mapLogic.playerCharNew; //mf soldBodyInfo = soldInfo.bodyInfo; //~mf }
public static void AddPartyToMap(MapLogic newMap) { if (!_gm.PM.Loaded) { _gm.PM.LoadPartyData(); //Ensure this only happens once } var characters = _gm.PM.GenerateLocalPlayerCharacters(); for (int i = 0; i < characters.Length; i++) { if (characters[i] != null) { newMap.AddChild(characters[i]); newMap.PlaceCharacter(characters[i]); GUIManager.UpdateFor(characters[i]); } } }
// Use this for initialization void Start() { mapLogic = MapLogic.Instance; childAudioInfos = GetComponentsInChildren <AudioInfo>(); if (!useOnePackMode) { InitCharactersSkinnedMeshRenderers(); } foreach (CutsceneCameraController ccc in camControllers) { ccc.parentCutsceneController = this; } foreach (CutsceneTimeline ct in timelines) { ct.parentCutsceneController = this; } HideCharacters(); }
public void BattleStart(int mapID) { // switchMapTime = BattleStartDelayTime; if (isBattleStart) { return; } playerHangNode = Camera.main.transform; Transform mapTr = GameObject.Find("Scene/map").transform; aiHangNode = mapTr.FindChild("obstacle").transform; otherPlayerHangNode = GameObject.Find("other_player").transform; mapLogic = mapTr.GetComponent <MapLogic>(); if (mapLogic == null) { mapLogic = mapTr.gameObject.AddComponent <MapLogic>(); } mapLogic.InitMap(mapID); InitPlayers(); isBattleStart = true; sortTimer = SortDeltaTime; }
void Start() { mapLogic = MapLogic.Instance; if (follow_SSAO) { if (ssao != null) { ssao.m_Blur = mapLogic.mapSSAO.m_Blur; ssao.m_Downsampling = mapLogic.mapSSAO.m_Downsampling; ssao.m_MinZ = mapLogic.mapSSAO.m_MinZ; ssao.m_OcclusionAttenuation = mapLogic.mapSSAO.m_OcclusionAttenuation; ssao.m_OcclusionIntensity = mapLogic.mapSSAO.m_OcclusionIntensity; ssao.m_Radius = mapLogic.mapSSAO.m_Radius; ssao.m_RandomTexture = mapLogic.mapSSAO.m_RandomTexture; ssao.m_SampleCount = mapLogic.mapSSAO.m_SampleCount; ssao.m_SSAOShader = mapLogic.mapSSAO.m_SSAOShader; } } if (follow_Bloom) { if (bloom != null) { bloom.tweakMode = mapLogic.mapBloom.tweakMode; bloom.screenBlendMode = mapLogic.mapBloom.screenBlendMode; bloom.hdr = mapLogic.mapBloom.hdr; bloom.lensflares = mapLogic.mapBloom.lensflares; bloom.bloomIntensity = mapLogic.mapBloom.bloomIntensity; bloom.bloomThreshhold = mapLogic.mapBloom.bloomThreshhold; bloom.bloomBlurIterations = mapLogic.mapBloom.bloomBlurIterations; bloom.sepBlurSpread = mapLogic.mapBloom.sepBlurSpread; bloom.useSrcAlphaAsMask = mapLogic.mapBloom.useSrcAlphaAsMask; } } }
public static void Start(string connectionString) { string logDatabase = Connector.TryExtractDatabaseNameWithPostfix(ref connectionString, "_Log"); SchemaBuilder sb = new SchemaBuilder(); sb.Schema.Version = typeof(Starter).Assembly.GetName().Version; sb.Schema.ForceCultureInfo = CultureInfo.GetCultureInfo("en-US"); MixinDeclarations.Register <OperationLogEntity, DiffLogMixin>(); MixinDeclarations.Register <UserEntity, UserEmployeeMixin>(); OverrideAttributes(sb); SetupDisconnectedStrategies(sb); DynamicQueryManager dqm = new DynamicQueryManager(); Connector.Default = new SqlConnector(connectionString, sb.Schema, dqm, SqlServerVersion.SqlServer2012); CacheLogic.Start(sb); TypeLogic.Start(sb, dqm); OperationLogic.Start(sb, dqm); MigrationLogic.Start(sb, dqm); CultureInfoLogic.Start(sb, dqm); EmbeddedFilePathLogic.Start(sb, dqm); SmtpConfigurationLogic.Start(sb, dqm); EmailLogic.Start(sb, dqm, () => Configuration.Value.Email, et => Configuration.Value.SmtpConfiguration); AuthLogic.Start(sb, dqm, "System", null); AuthLogic.StartAllModules(sb, dqm); ResetPasswordRequestLogic.Start(sb, dqm); UserTicketLogic.Start(sb, dqm); SessionLogLogic.Start(sb, dqm); ProcessLogic.Start(sb, dqm); PackageLogic.Start(sb, dqm, packages: true, packageOperations: true); MapLogic.Start(sb, dqm); SchedulerLogic.Start(sb, dqm); QueryLogic.Start(sb); UserQueryLogic.Start(sb, dqm); UserQueryLogic.RegisterUserTypeCondition(sb, SouthwindGroup.UserEntities); UserQueryLogic.RegisterRoleTypeCondition(sb, SouthwindGroup.RoleEntities); ChartLogic.Start(sb, dqm); UserChartLogic.RegisterUserTypeCondition(sb, SouthwindGroup.UserEntities); UserChartLogic.RegisterRoleTypeCondition(sb, SouthwindGroup.RoleEntities); DashboardLogic.Start(sb, dqm); DashboardLogic.RegisterUserTypeCondition(sb, SouthwindGroup.UserEntities); DashboardLogic.RegisterRoleTypeCondition(sb, SouthwindGroup.RoleEntities); ViewLogLogic.Start(sb, dqm, new HashSet <Type> { typeof(UserQueryEntity), typeof(UserChartEntity), typeof(DashboardEntity) }); DiffLogLogic.Start(sb, dqm); ExceptionLogic.Start(sb, dqm); SMSLogic.Start(sb, dqm, null, () => Configuration.Value.Sms); SMSLogic.RegisterPhoneNumberProvider <PersonEntity>(p => p.Phone, p => null); SMSLogic.RegisterDataObjectProvider((PersonEntity p) => new { p.FirstName, p.LastName, p.Title, p.DateOfBirth }); SMSLogic.RegisterPhoneNumberProvider <CompanyEntity>(p => p.Phone, p => null); NoteLogic.Start(sb, dqm, typeof(UserEntity), /*Note*/ typeof(OrderEntity)); AlertLogic.Start(sb, dqm, typeof(UserEntity), /*Alert*/ typeof(OrderEntity)); FileLogic.Start(sb, dqm); TranslationLogic.Start(sb, dqm); TranslatedInstanceLogic.Start(sb, dqm, () => CultureInfo.GetCultureInfo("en")); HelpLogic.Start(sb, dqm); WordTemplateLogic.Start(sb, dqm); EmployeeLogic.Start(sb, dqm); ProductLogic.Start(sb, dqm); CustomerLogic.Start(sb, dqm); OrderLogic.Start(sb, dqm); ShipperLogic.Start(sb, dqm); StartSouthwindConfiguration(sb, dqm); TypeConditionLogic.Register <OrderEntity>(SouthwindGroup.UserEntities, o => o.Employee.RefersTo(EmployeeEntity.Current)); TypeConditionLogic.Register <EmployeeEntity>(SouthwindGroup.UserEntities, e => e == EmployeeEntity.Current); TypeConditionLogic.Register <OrderEntity>(SouthwindGroup.CurrentCustomer, o => o.Customer == CustomerEntity.Current); TypeConditionLogic.Register <PersonEntity>(SouthwindGroup.CurrentCustomer, o => o == CustomerEntity.Current); TypeConditionLogic.Register <CompanyEntity>(SouthwindGroup.CurrentCustomer, o => o == CustomerEntity.Current); DisconnectedLogic.Start(sb, dqm); DisconnectedLogic.BackupFolder = @"D:\SouthwindTemp\Backups"; DisconnectedLogic.BackupNetworkFolder = @"D:\SouthwindTemp\Backups"; DisconnectedLogic.DatabaseFolder = @"D:\SouthwindTemp\Database"; ProfilerLogic.Start(sb, dqm, timeTracker: true, heavyProfiler: true, overrideSessionTimeout: true); SetupCache(sb); SetSchemaNames(Schema.Current); if (logDatabase.HasText()) { SetLogDatabase(sb.Schema, new DatabaseName(null, logDatabase)); } Schema.Current.OnSchemaCompleted(); }
public void Init() { childSkinnedMeshRenderers = GetComponentsInChildren <SkinnedMeshRenderer>(); childMeshRenderers = GetComponentsInChildren <MeshRenderer>(); charInfo = GetComponent <CharacterInfo>(); bodyInfo = GetComponentInChildren <SoldierBodyInfo>(); body = bodyInfo.gameObject; //fullAnimationsClip = bodyInfo.fullAnimsClip; charInfo.shootRaycastTargets = bodyInfo.shootRaycastTargets; Vector3 oldPos; CharacterController soldGenInfoCharController = soldierGeneralInfo.GetComponent <CharacterController>(); charController = gameObject.AddComponent <CharacterController>(); charController.center = soldGenInfoCharController.center; charController.slopeLimit = soldGenInfoCharController.slopeLimit; charController.stepOffset = soldGenInfoCharController.stepOffset; charController.radius = soldGenInfoCharController.radius; charController.height = soldGenInfoCharController.height; //soldierRoot = bodyInfo.soldierRoot; //soldierUpperBodyRoot = bodyInfo.soldierUpperBodyRoot; //soldierGunRoot = bodyInfo.soldierGunRoot; soldierGunFireTr = bodyInfo.soldierGunFireTr; animObject = bodyInfo.SoldierAnimObject; soldierEye = bodyInfo.soldierEyeTr; movementInfos = soldierGeneralInfo.movementInfos; idleInfos = soldierGeneralInfo.idleInfos; //voiceAudioSource = GameObject.Instantiate(soldierGeneralInfo.AudioSource_Voice) as AudioSource; //oldPos = voiceAudioSource.transform.position; //voiceAudioSource.transform.parent = gameObject.transform; //voiceAudioSource.transform.localPosition = oldPos; //footStepsAudioSource = GameObject.Instantiate(soldierGeneralInfo.AudioSource_FootSteps) as AudioSource; //oldPos = footStepsAudioSource.transform.position; //footStepsAudioSource.transform.parent = gameObject.transform; //footStepsAudioSource.transform.localPosition = oldPos; //gunAudioSource = GameObject.Instantiate(soldierGeneralInfo.AudioSource_Gun) as AudioSource; //oldPos = gunAudioSource.transform.position; //gunAudioSource.transform.parent = gameObject.transform; //gunAudioSource.transform.localPosition = oldPos; if (charInfo.FightSide == FightSideEnum.Ally) { voiceAudioInfo = GameObject.Instantiate(soldierGeneralInfo.AudioInfo_Ally_Voice) as AudioInfo; } else { voiceAudioInfo = GameObject.Instantiate(soldierGeneralInfo.AudioInfo_Voice) as AudioInfo; } oldPos = voiceAudioInfo.transform.position; voiceAudioInfo.transform.parent = gameObject.transform; voiceAudioInfo.transform.localPosition = oldPos; if (charInfo.FightSide == FightSideEnum.Ally) { footStepsAudioInfo = GameObject.Instantiate(soldierGeneralInfo.AudioInfo_Ally_FootSteps) as AudioInfo; } else { footStepsAudioInfo = GameObject.Instantiate(soldierGeneralInfo.AudioInfo_FootSteps) as AudioInfo; } oldPos = footStepsAudioInfo.transform.position; footStepsAudioInfo.transform.parent = gameObject.transform; footStepsAudioInfo.transform.localPosition = oldPos; if (charInfo.FightSide == FightSideEnum.Ally) { gunAudioInfo = GameObject.Instantiate(soldierGeneralInfo.AudioInfo_Ally_Gun) as AudioInfo; } else { gunAudioInfo = GameObject.Instantiate(soldierGeneralInfo.AudioInfo_Gun) as AudioInfo; } oldPos = gunAudioInfo.transform.position; gunAudioInfo.transform.parent = gameObject.transform; gunAudioInfo.transform.localPosition = oldPos; charInfo.fightHaloRaycastTargets = new Transform[soldierGeneralInfo.fightHaloRaycastTargets.Length]; for (int i = 0; i < soldierGeneralInfo.fightHaloRaycastTargets.Length; i++) { Transform tr = GameObject.Instantiate(soldierGeneralInfo.fightHaloRaycastTargets[i]) as Transform; oldPos = tr.position; tr.parent = gameObject.transform; tr.localPosition = oldPos; charInfo.fightHaloRaycastTargets[i] = tr; } InitAStar(); mapLogic = MapLogic.Instance; mapLogic.AddChar(gameObject); //soundPlay_VoiceMain.Init(voiceAudioSource); ResetVoiceBusyTimeCounter(); //soundPlay_VoiceMain.OnPlay += ResetVoiceBusyTimeCounter; gun = gameObject.AddComponent <SoldierGun>(); gun.InitGun(gunInfo); //gun.InitAudioSource(gunAudioSource); gun.InitAudioInfo(gunAudioInfo); fightRange = Mathf.Min(gun.range, charInfo.Range); footStepRaycastStartTr = soldierGeneralInfo.footRayCastStartTr; footStepRaycastEndTr = soldierGeneralInfo.footRayCastEndTr; footStepDelayGraph = soldierGeneralInfo.footStepDelayGraph; footStepSoundList = soldierGeneralInfo.footStepSoundList; soldHead = charInfo.characterHead; if (PlayerCharacterNew.Instance != null) { plHead = PlayerCharacterNew.Instance.gameObject.GetComponent <CharacterInfo>().characterHead; //plLeftView = PlayerCharacterNew.Instance.leftViewTr; //plRightView = PlayerCharacterNew.Instance.rightViewTr; } isInited = true; }
public static void Start(string connectionString) { using (HeavyProfiler.Log("Start")) using (var initial = HeavyProfiler.Log("Initial")) { StartParameters.IgnoredDatabaseMismatches = new List <Exception>(); StartParameters.IgnoredCodeErrors = new List <Exception>(); string?logDatabase = Connector.TryExtractDatabaseNameWithPostfix(ref connectionString, "_Log"); SchemaBuilder sb = new CustomSchemaBuilder { LogDatabaseName = logDatabase, Tracer = initial }; sb.Schema.Version = typeof(Starter).Assembly.GetName().Version; sb.Schema.ForceCultureInfo = CultureInfo.GetCultureInfo("en-US"); MixinDeclarations.Register <OperationLogEntity, DiffLogMixin>(); MixinDeclarations.Register <UserEntity, UserEmployeeMixin>(); OverrideAttributes(sb); var detector = SqlServerVersionDetector.Detect(connectionString); Connector.Default = new SqlConnector(connectionString, sb.Schema, detector !.Value); CacheLogic.Start(sb); DynamicLogicStarter.Start(sb); DynamicLogic.CompileDynamicCode(); DynamicLogic.RegisterMixins(); DynamicLogic.BeforeSchema(sb); TypeLogic.Start(sb); OperationLogic.Start(sb); ExceptionLogic.Start(sb); MigrationLogic.Start(sb); CultureInfoLogic.Start(sb); FilePathEmbeddedLogic.Start(sb); SmtpConfigurationLogic.Start(sb); EmailLogic.Start(sb, () => Configuration.Value.Email, (et, target) => Configuration.Value.SmtpConfiguration); AuthLogic.Start(sb, "System", null); AuthLogic.StartAllModules(sb); ResetPasswordRequestLogic.Start(sb); UserTicketLogic.Start(sb); SessionLogLogic.Start(sb); ProcessLogic.Start(sb); PackageLogic.Start(sb, packages: true, packageOperations: true); SchedulerLogic.Start(sb); QueryLogic.Start(sb); UserQueryLogic.Start(sb); UserQueryLogic.RegisterUserTypeCondition(sb, SouthwindGroup.UserEntities); UserQueryLogic.RegisterRoleTypeCondition(sb, SouthwindGroup.RoleEntities); ChartLogic.Start(sb); UserChartLogic.RegisterUserTypeCondition(sb, SouthwindGroup.UserEntities); UserChartLogic.RegisterRoleTypeCondition(sb, SouthwindGroup.RoleEntities); DashboardLogic.Start(sb); DashboardLogic.RegisterUserTypeCondition(sb, SouthwindGroup.UserEntities); DashboardLogic.RegisterRoleTypeCondition(sb, SouthwindGroup.RoleEntities); ViewLogLogic.Start(sb, new HashSet <Type> { typeof(UserQueryEntity), typeof(UserChartEntity), typeof(DashboardEntity) }); DiffLogLogic.Start(sb, registerAll: true); ExcelLogic.Start(sb, excelReport: true); ToolbarLogic.Start(sb); SMSLogic.Start(sb, null, () => Configuration.Value.Sms); SMSLogic.RegisterPhoneNumberProvider <PersonEntity>(p => p.Phone, p => null); SMSLogic.RegisterDataObjectProvider((PersonEntity p) => new { p.FirstName, p.LastName, p.Title, p.DateOfBirth }); SMSLogic.RegisterPhoneNumberProvider <CompanyEntity>(p => p.Phone, p => null); NoteLogic.Start(sb, typeof(UserEntity), /*Note*/ typeof(OrderEntity)); AlertLogic.Start(sb, typeof(UserEntity), /*Alert*/ typeof(OrderEntity)); FileLogic.Start(sb); TranslationLogic.Start(sb, countLocalizationHits: false); TranslatedInstanceLogic.Start(sb, () => CultureInfo.GetCultureInfo("en")); HelpLogic.Start(sb); WordTemplateLogic.Start(sb); MapLogic.Start(sb); PredictorLogic.Start(sb, () => new FileTypeAlgorithm(f => new PrefixPair(Starter.Configuration.Value.Folders.PredictorModelFolder))); PredictorLogic.RegisterAlgorithm(CNTKPredictorAlgorithm.NeuralNetwork, new CNTKNeuralNetworkPredictorAlgorithm()); PredictorLogic.RegisterPublication(ProductPredictorPublication.MonthlySales, new PublicationSettings(typeof(OrderEntity))); RestLogLogic.Start(sb); RestApiKeyLogic.Start(sb); WorkflowLogicStarter.Start(sb, () => Starter.Configuration.Value.Workflow); EmployeeLogic.Start(sb); ProductLogic.Start(sb); CustomerLogic.Start(sb); OrderLogic.Start(sb); ShipperLogic.Start(sb); StartSouthwindConfiguration(sb); TypeConditionLogic.Register <OrderEntity>(SouthwindGroup.UserEntities, o => o.Employee == EmployeeEntity.Current); TypeConditionLogic.Register <EmployeeEntity>(SouthwindGroup.UserEntities, e => EmployeeEntity.Current.Is(e)); TypeConditionLogic.Register <OrderEntity>(SouthwindGroup.CurrentCustomer, o => o.Customer == CustomerEntity.Current); TypeConditionLogic.Register <PersonEntity>(SouthwindGroup.CurrentCustomer, o => o == CustomerEntity.Current); TypeConditionLogic.Register <CompanyEntity>(SouthwindGroup.CurrentCustomer, o => o == CustomerEntity.Current); ProfilerLogic.Start(sb, timeTracker: true, heavyProfiler: true, overrideSessionTimeout: true); DynamicLogic.StartDynamicModules(sb); DynamicLogic.RegisterExceptionIfAny(); SetupCache(sb); Schema.Current.OnSchemaCompleted(); } }
public static void Start(string connectionString, bool isPostgres, bool includeDynamic = true, bool detectSqlVersion = true) { using (HeavyProfiler.Log("Start")) using (var initial = HeavyProfiler.Log("Initial")) { StartParameters.IgnoredDatabaseMismatches = new List <Exception>(); StartParameters.IgnoredCodeErrors = new List <Exception>(); string?logDatabase = Connector.TryExtractDatabaseNameWithPostfix(ref connectionString, "_Log"); SchemaBuilder sb = new CustomSchemaBuilder { LogDatabaseName = logDatabase, Tracer = initial }; sb.Schema.Version = typeof(Starter).Assembly.GetName().Version !; sb.Schema.ForceCultureInfo = CultureInfo.GetCultureInfo("en-US"); MixinDeclarations.Register <OperationLogEntity, DiffLogMixin>(); MixinDeclarations.Register <UserEntity, UserEmployeeMixin>(); MixinDeclarations.Register <OrderDetailEmbedded, OrderDetailMixin>(); MixinDeclarations.Register <BigStringEmbedded, BigStringMixin>(); ConfigureBigString(sb); OverrideAttributes(sb); if (!isPostgres) { var sqlVersion = detectSqlVersion ? SqlServerVersionDetector.Detect(connectionString) : SqlServerVersion.AzureSQL; Connector.Default = new SqlServerConnector(connectionString, sb.Schema, sqlVersion !.Value); } else { var postgreeVersion = detectSqlVersion ? PostgresVersionDetector.Detect(connectionString) : null; Connector.Default = new PostgreSqlConnector(connectionString, sb.Schema, postgreeVersion); } CacheLogic.Start(sb, cacheInvalidator: sb.Settings.IsPostgres ? new PostgresCacheInvalidation() : null); DynamicLogicStarter.Start(sb); if (includeDynamic)//Dynamic { DynamicLogic.CompileDynamicCode(); DynamicLogic.RegisterMixins(); DynamicLogic.BeforeSchema(sb); }//Dynamic // Framework modules TypeLogic.Start(sb); OperationLogic.Start(sb); ExceptionLogic.Start(sb); QueryLogic.Start(sb); // Extensions modules MigrationLogic.Start(sb); CultureInfoLogic.Start(sb); FilePathEmbeddedLogic.Start(sb); BigStringLogic.Start(sb); EmailLogic.Start(sb, () => Configuration.Value.Email, (template, target, message) => Configuration.Value.EmailSender); AuthLogic.Start(sb, "System", "Anonymous"); /* null); anonymous*/ AuthLogic.StartAllModules(sb); ResetPasswordRequestLogic.Start(sb); UserTicketLogic.Start(sb); SessionLogLogic.Start(sb); WebAuthnLogic.Start(sb, () => Configuration.Value.WebAuthn); ProcessLogic.Start(sb); PackageLogic.Start(sb, packages: true, packageOperations: true); SchedulerLogic.Start(sb); OmniboxLogic.Start(sb); UserQueryLogic.Start(sb); UserQueryLogic.RegisterUserTypeCondition(sb, RG2Group.UserEntities); UserQueryLogic.RegisterRoleTypeCondition(sb, RG2Group.RoleEntities); UserQueryLogic.RegisterTranslatableRoutes(); ChartLogic.Start(sb, googleMapsChartScripts: false /*requires Google Maps API key in ChartClient */); UserChartLogic.RegisterUserTypeCondition(sb, RG2Group.UserEntities); UserChartLogic.RegisterRoleTypeCondition(sb, RG2Group.RoleEntities); UserChartLogic.RegisterTranslatableRoutes(); DashboardLogic.Start(sb); DashboardLogic.RegisterUserTypeCondition(sb, RG2Group.UserEntities); DashboardLogic.RegisterRoleTypeCondition(sb, RG2Group.RoleEntities); DashboardLogic.RegisterTranslatableRoutes(); ViewLogLogic.Start(sb, new HashSet <Type> { typeof(UserQueryEntity), typeof(UserChartEntity), typeof(DashboardEntity) }); DiffLogLogic.Start(sb, registerAll: true); ExcelLogic.Start(sb, excelReport: true); ToolbarLogic.Start(sb); ToolbarLogic.RegisterTranslatableRoutes(); FileLogic.Start(sb); TranslationLogic.Start(sb, countLocalizationHits: false); TranslatedInstanceLogic.Start(sb, () => CultureInfo.GetCultureInfo("en")); HelpLogic.Start(sb); WordTemplateLogic.Start(sb); MapLogic.Start(sb); RestLogLogic.Start(sb); RestApiKeyLogic.Start(sb); WorkflowLogicStarter.Start(sb, () => Starter.Configuration.Value.Workflow); ProfilerLogic.Start(sb, timeTracker: true, heavyProfiler: true, overrideSessionTimeout: true); // RG2 modules EmployeeLogic.Start(sb); ProductLogic.Start(sb); CustomerLogic.Start(sb); OrderLogic.Start(sb); ShipperLogic.Start(sb); ItemLogic.Start(sb); ItemCategoryLogic.Start(sb); StartRG2Configuration(sb); TypeConditionLogic.Register <OrderEntity>(RG2Group.UserEntities, o => o.Employee == EmployeeEntity.Current); TypeConditionLogic.Register <EmployeeEntity>(RG2Group.UserEntities, e => EmployeeEntity.Current.Is(e)); TypeConditionLogic.Register <OrderEntity>(RG2Group.CurrentCustomer, o => o.Customer == CustomerEntity.Current); TypeConditionLogic.Register <PersonEntity>(RG2Group.CurrentCustomer, o => o == CustomerEntity.Current); TypeConditionLogic.Register <CompanyEntity>(RG2Group.CurrentCustomer, o => o == CustomerEntity.Current); if (includeDynamic)//2 { DynamicLogic.StartDynamicModules(sb); }//2 SetupCache(sb); Schema.Current.OnSchemaCompleted(); if (includeDynamic)//3 { DynamicLogic.RegisterExceptionIfAny(); }//3 } }
public void LoadMap(MapLogic Logic) { }
public static void Start(string connectionString, bool includeDynamic = true) { using (HeavyProfiler.Log("Start")) using (var initial = HeavyProfiler.Log("Initial")) { string? logDatabase = Connector.TryExtractDatabaseNameWithPostfix(ref connectionString, "_Log"); SchemaBuilder sb = new CustomSchemaBuilder { LogDatabaseName = logDatabase, Tracer = initial }; sb.Schema.Version = typeof(Starter).Assembly.GetName().Version!; sb.Schema.ForceCultureInfo = CultureInfo.GetCultureInfo("en-US"); MixinDeclarations.Register<OperationLogEntity, DiffLogMixin>(); MixinDeclarations.Register<UserEntity, UserEmployeeMixin>(); OverrideAttributes(sb); var detector = SqlServerVersionDetector.Detect(connectionString); Connector.Default = new SqlConnector(connectionString, sb.Schema, detector!.Value); CacheLogic.Start(sb); } TypeLogic.Start(sb); OperationLogic.Start(sb); ExceptionLogic.Start(sb); MigrationLogic.Start(sb); CultureInfoLogic.Start(sb); FilePathEmbeddedLogic.Start(sb); EmailLogic.Start(sb, () => Configuration.Value.Email, (et, target) => Configuration.Value.EmailSender); AuthLogic.Start(sb, "System", null); AuthLogic.StartAllModules(sb); ResetPasswordRequestLogic.Start(sb); UserTicketLogic.Start(sb); ProcessLogic.Start(sb); PackageLogic.Start(sb, packages: true, packageOperations: true); SchedulerLogic.Start(sb); QueryLogic.Start(sb); UserQueryLogic.Start(sb); UserQueryLogic.RegisterUserTypeCondition(sb, AtTestGroup.UserEntities); UserQueryLogic.RegisterRoleTypeCondition(sb, AtTestGroup.RoleEntities); ChartLogic.Start(sb); UserChartLogic.RegisterUserTypeCondition(sb, AtTestGroup.UserEntities); UserChartLogic.RegisterRoleTypeCondition(sb, AtTestGroup.RoleEntities); DashboardLogic.Start(sb); DashboardLogic.RegisterUserTypeCondition(sb, AtTestGroup.UserEntities); DashboardLogic.RegisterRoleTypeCondition(sb, AtTestGroup.RoleEntities); ViewLogLogic.Start(sb, new HashSet<Type> { typeof(UserQueryEntity), typeof(UserChartEntity), typeof(DashboardEntity) }); DiffLogLogic.Start(sb, registerAll: true); ExcelLogic.Start(sb, excelReport: true); ToolbarLogic.Start(sb); FileLogic.Start(sb); TranslationLogic.Start(sb, countLocalizationHits: false); TranslatedInstanceLogic.Start(sb, () => CultureInfo.GetCultureInfo("en")); WordTemplateLogic.Start(sb); MapLogic.Start(sb); PredictorLogic.Start(sb, () => new FileTypeAlgorithm(f => new PrefixPair(Starter.Configuration.Value.Folders.PredictorModelFolder))); PredictorLogic.RegisterAlgorithm(CNTKPredictorAlgorithm.NeuralNetwork, new CNTKNeuralNetworkPredictorAlgorithm()); PredictorLogic.RegisterPublication(ProductPredictorPublication.MonthlySales, new PublicationSettings(typeof(OrderEntity))); EmployeeLogic.Start(sb); ProductLogic.Start(sb); CustomerLogic.Start(sb); OrderLogic.Start(sb); ShipperLogic.Start(sb); StartAtTestConfiguration(sb); TypeConditionLogic.Register<OrderEntity>(AtTestGroup.UserEntities, o => o.Employee == EmployeeEntity.Current); TypeConditionLogic.Register<EmployeeEntity>(AtTestGroup.UserEntities, e => EmployeeEntity.Current.Is(e)); TypeConditionLogic.Register<OrderEntity>(AtTestGroup.CurrentCustomer, o => o.Customer == CustomerEntity.Current); TypeConditionLogic.Register<PersonEntity>(AtTestGroup.CurrentCustomer, o => o == CustomerEntity.Current); TypeConditionLogic.Register<CompanyEntity>(AtTestGroup.CurrentCustomer, o => o == CustomerEntity.Current); ProfilerLogic.Start(sb, timeTracker: true, heavyProfiler: true, overrideSessionTimeout: true); if (includeDynamic) { } SetupCache(sb); Schema.Current.OnSchemaCompleted(); }
// Use this for initialization void Start() { mapLogic = MapLogic.Instance; playerCharNew = PlayerCharacterNew.Instance; }
void Start() { mapLogic = MapLogic.Instance; }
public static void Start(string connectionString, bool isPostgres, string?azureStorageConnectionString, string?broadcastSecret, string?broadcastUrls, bool includeDynamic = true, bool detectSqlVersion = true) { AzureStorageConnectionString = azureStorageConnectionString; using (HeavyProfiler.Log("Start")) using (var initial = HeavyProfiler.Log("Initial")) { StartParameters.IgnoredDatabaseMismatches = new List <Exception>(); StartParameters.IgnoredCodeErrors = new List <Exception>(); string?logDatabase = Connector.TryExtractDatabaseNameWithPostfix(ref connectionString, "_Log"); SchemaBuilder sb = new CustomSchemaBuilder { LogDatabaseName = logDatabase, Tracer = initial }; sb.Schema.Version = typeof(Starter).Assembly.GetName().Version !; sb.Schema.ForceCultureInfo = CultureInfo.GetCultureInfo("en-US"); MixinDeclarations.Register <OperationLogEntity, DiffLogMixin>(); MixinDeclarations.Register <UserEntity, UserEmployeeMixin>(); MixinDeclarations.Register <OrderDetailEmbedded, OrderDetailMixin>(); MixinDeclarations.Register <BigStringEmbedded, BigStringMixin>(); ConfigureBigString(sb); OverrideAttributes(sb); if (!isPostgres) { var sqlVersion = detectSqlVersion ? SqlServerVersionDetector.Detect(connectionString) : SqlServerVersion.AzureSQL; Connector.Default = new SqlServerConnector(connectionString, sb.Schema, sqlVersion !.Value); } else { var postgreeVersion = detectSqlVersion ? PostgresVersionDetector.Detect(connectionString) : null; Connector.Default = new PostgreSqlConnector(connectionString, sb.Schema, postgreeVersion); } CacheLogic.Start(sb, serverBroadcast: sb.Settings.IsPostgres ? new PostgresBroadcast() : broadcastSecret != null && broadcastUrls != null ? new SimpleHttpBroadcast(broadcastSecret, broadcastUrls) : null);/*Cache*/ /* LightDynamic * DynamicLogic.Start(sb, withCodeGen: false); * LightDynamic */ DynamicLogicStarter.Start(sb); if (includeDynamic)//Dynamic { DynamicLogic.CompileDynamicCode(); DynamicLogic.RegisterMixins(); DynamicLogic.BeforeSchema(sb); }//Dynamic // Framework modules TypeLogic.Start(sb); OperationLogic.Start(sb); ExceptionLogic.Start(sb); QueryLogic.Start(sb); // Extensions modules MigrationLogic.Start(sb); CultureInfoLogic.Start(sb); FilePathEmbeddedLogic.Start(sb); BigStringLogic.Start(sb); EmailLogic.Start(sb, () => Configuration.Value.Email, (template, target, message) => Configuration.Value.EmailSender); AuthLogic.Start(sb, "System", "Anonymous"); /* null); anonymous*/ AuthLogic.Authorizer = new SouthwindAuthorizer(() => Configuration.Value.ActiveDirectory); AuthLogic.StartAllModules(sb, activeDirectoryIntegration: true); AzureADLogic.Start(sb, adGroups: true, deactivateUsersTask: true); ResetPasswordRequestLogic.Start(sb); UserTicketLogic.Start(sb); SessionLogLogic.Start(sb); TypeConditionLogic.RegisterCompile <UserEntity>(SouthwindTypeCondition.UserEntities, u => u.Is(UserEntity.Current)); ProcessLogic.Start(sb); PackageLogic.Start(sb, packages: true, packageOperations: true); SchedulerLogic.Start(sb); OmniboxLogic.Start(sb); UserQueryLogic.Start(sb); UserQueryLogic.RegisterUserTypeCondition(sb, SouthwindTypeCondition.UserEntities); UserQueryLogic.RegisterRoleTypeCondition(sb, SouthwindTypeCondition.RoleEntities); UserQueryLogic.RegisterTranslatableRoutes(); ChartLogic.Start(sb, googleMapsChartScripts: false /*requires Google Maps API key in ChartClient */); UserChartLogic.RegisterUserTypeCondition(sb, SouthwindTypeCondition.UserEntities); UserChartLogic.RegisterRoleTypeCondition(sb, SouthwindTypeCondition.RoleEntities); UserChartLogic.RegisterTranslatableRoutes(); DashboardLogic.Start(sb, GetFileTypeAlgorithm(p => p.CachedQueryFolder)); DashboardLogic.RegisterUserTypeCondition(sb, SouthwindTypeCondition.UserEntities); DashboardLogic.RegisterRoleTypeCondition(sb, SouthwindTypeCondition.RoleEntities); DashboardLogic.RegisterTranslatableRoutes(); ViewLogLogic.Start(sb, new HashSet <Type> { typeof(UserQueryEntity), typeof(UserChartEntity), typeof(DashboardEntity) }); SystemEventLogLogic.Start(sb); DiffLogLogic.Start(sb, registerAll: true); ExcelLogic.Start(sb, excelReport: true); ToolbarLogic.Start(sb); ToolbarLogic.RegisterTranslatableRoutes(); SMSLogic.Start(sb, null, () => Configuration.Value.Sms); NoteLogic.Start(sb, typeof(UserEntity), /*Note*/ typeof(OrderEntity)); AlertLogic.Start(sb, typeof(UserEntity), /*Alert*/ typeof(OrderEntity)); FileLogic.Start(sb); TranslationLogic.Start(sb, countLocalizationHits: false); TranslatedInstanceLogic.Start(sb, () => CultureInfo.GetCultureInfo("en")); HelpLogic.Start(sb); WordTemplateLogic.Start(sb); MapLogic.Start(sb); PredictorLogic.Start(sb, GetFileTypeAlgorithm(p => p.PredictorModelFolder)); PredictorLogic.RegisterAlgorithm(TensorFlowPredictorAlgorithm.NeuralNetworkGraph, new TensorFlowNeuralNetworkPredictor()); PredictorLogic.RegisterPublication(ProductPredictorPublication.MonthlySales, new PublicationSettings(typeof(OrderEntity))); RestLogLogic.Start(sb); RestApiKeyLogic.Start(sb); WorkflowLogicStarter.Start(sb, () => Starter.Configuration.Value.Workflow); ProfilerLogic.Start(sb, timeTracker: true, heavyProfiler: true, overrideSessionTimeout: true); // Southwind modules EmployeeLogic.Start(sb); ProductLogic.Start(sb); CustomerLogic.Start(sb); OrderLogic.Start(sb); ShipperLogic.Start(sb); StartSouthwindConfiguration(sb); TypeConditionLogic.Register <OrderEntity>(SouthwindTypeCondition.CurrentEmployee, o => o.Employee.Is(EmployeeEntity.Current)); if (includeDynamic)//2 { DynamicLogic.StartDynamicModules(sb); }//2 SetupCache(sb); Schema.Current.OnSchemaCompleted(); if (includeDynamic)//3 { DynamicLogic.RegisterExceptionIfAny(); }//3 } }
//Keeping the player on the grid with smooth movement requires a fixed framerate. void FixedUpdate() { //seeing if skipping a frame fixes a rare map bug if (skipNextFrame) { skipNextFrame = false; return; } AnimationEvent(this); //only animation allowed if canAct is off if (!canAct) { return; } if (ml == null) { ml = GameObject.Find("LevelData").GetComponent <MapLogic>(); } //Not ellegant, but check every frame to see if the map BGM should play ml.StartMusic(); //isOnGrid = false; if (isMoving) { transform.position = transform.position + moveVector * moveSpeed; CheckForGridAlignment(); if (isOnGrid && canAct) { isMoving = false; ml.FinishStep(); } } //float deltaX = Mathf.Abs(Mathf.RoundToInt(transform.position.x / grid) - (transform.position.x / grid)); //float deltaY = Mathf.Abs(Mathf.RoundToInt(transform.position.y / grid) - (transform.position.y / grid)); //if (deltaX <= delta && deltaY <= delta) isOnGrid = true; CheckForGridAlignment(); //movement if (isOnGrid && canAct && canMove) { isMoving = false; if (currentVertical < -0.2f && currentVertical < currentHorizontal) { //Move Down moveDirection = StaticData.DIR_DOWN; //check for collision if (!CheckForCollision(StaticData.DIR_DOWN)) { isMoving = true; moveVector = Vector3.zero; moveVector.y = -1; canMove = keypressForEachTile ? false : true; } } else if (currentVertical > 0.2f && currentVertical > currentHorizontal) { //Move down moveDirection = StaticData.DIR_UP; if (!CheckForCollision(StaticData.DIR_UP)) { isMoving = true; moveVector = Vector3.zero; moveVector.y = 1; canMove = keypressForEachTile ? false : true; } } else if (currentHorizontal > 0.2f) { //Move right moveDirection = StaticData.DIR_RIGHT; if (!CheckForCollision(StaticData.DIR_RIGHT)) { isMoving = true; moveVector = Vector3.zero; moveVector.x = 1; canMove = keypressForEachTile ? false : true; } } else if (currentHorizontal < -0.2f) { //Move left moveDirection = StaticData.DIR_LEFT; if (!CheckForCollision(StaticData.DIR_LEFT)) { isMoving = true; moveVector = Vector3.zero; moveVector.x = -1; canMove = keypressForEachTile ? false : true; } } } // end movement }