public static string GetLevel(LevelEnum level) { switch (level) { case LevelEnum.start: return("Summer in Canada"); case LevelEnum.first: return("Diamond dust"); case LevelEnum.second: return("Snow flurry"); case LevelEnum.third: return("Snowsquall"); case LevelEnum.fourth: return("Snow storm"); case LevelEnum.fifth: return("Blizzard"); case LevelEnum.sixth: return("Arctic mayhem!"); case LevelEnum.seventh: return("THUNDER SNOW!"); case LevelEnum.final: return("»»» ULTRA INSTINCT «««"); default: return(""); } }
/// <summary> /// info /// </summary> /// <param name="contextCode">会话标识,线上:一次请求生命周期中的日志编码,一次请求响应使用一个编码</param> /// <param name="logicType">项目逻辑枚举类型</param> /// <param name="level">日志级别</param> /// <param name="loggerCode">日志编码,填写线下记录编码linerecordcode</param> /// <param name="parkingCode">停车场编码</param> /// <param name="carNoOrCardNo">车牌号或卡号</param> /// <param name="projectInfo">项目标识</param> /// <param name="message">请求的参数或者实体json</param> /// <param name="exception"> 错误信息或者异常信息</param> public static void SetLoggerInfo( string contextCode, LoggerLogicEnum logicType, LevelEnum level, string loggerCode, string parkingCode, string carNoOrCardNo, string projectInfo, string message, string exception) { Dictionary <string, object> arguments = new Dictionary <string, object>(); arguments["LogicType"] = logicType.ToString(); arguments["ContextCode"] = contextCode; arguments["LoggerCode"] = loggerCode; arguments["Level"] = level; arguments["ParkingCode"] = parkingCode; arguments["CarNoOrCardNo"] = carNoOrCardNo; arguments["ProjectInfo"] = projectInfo; arguments["Message"] = message; arguments["Exception"] = exception; arguments["CreateTime"] = DateTime.Now.ToString(); arguments["Ip"] = Dns.GetHostAddresses(Dns.GetHostName()).First(p => p.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).ToString(); try { IDatabase db = RedisHelper.GetDatabase(9); string key = string.Format("ApiLoggerInfo_{0}", DateTime.Now.Minute); db.ListRightPush(key, jsonserializationer.Serialize(arguments)); db.KeyExpireAsync(key, DateTime.Now.AddMinutes(5)); //5分钟过期 } catch { } finally { } }
public void FinishLevel(LevelEnum level, int score = 100, bool doSave = true) { Level lvl = this.levels [level]; if (lvl.score < score) { lvl.score = score; } this.playerData.setScore(level, score); // Update Google Play Games Leaderboard if (doSave) { int totalScore = GetTotalScore(); PlayGamesScript.AddScoreToLeaderboard(Config.LEADERBOARD_OVERALL_SCORE, totalScore); } // If level is a story, unlock the next world if (lvl.isStory) { UnlockWorld(this.levels [lvl.nextLevel].world.id); } if (doSave) { Save(); } }
string[] LosOp(ref string[] getallen) { LevelEnum level = VolgordeBewerkingen(getallen); string[] nieuw = new string[getallen.Length - 2]; switch (level) { case LevelEnum.Som: nieuw = LosSomOp(getallen, nieuw); break; case LevelEnum.Maal: nieuw = LosMaalOp(getallen, nieuw); break; case LevelEnum.Haakjes: nieuw = LosHaakjesOp(getallen, nieuw); break; default: break; } return(nieuw); }
void Start() { #if UNITY_IOS serverConnect.SetActive(false); gameConnectPanel.gameObject.SetActive(false); connectPanel.gameObject.SetActive(true); #endif //logLevel = LogFilter.FilterLevel.Debug; GameObject es = GameObject.Find("EventSystem"); GameObject.DontDestroyOnLoad(es); isPause = false; SingletonNM = this; currentMode = NetworkMode.Level; selectedDifficulty = selectedDifficulty = LevelEnum.Unselected; //currentPanel = connectPanel; lobbyPlayerArray = new ArrayList(maxPlayers); gameplayerControllers = new ArrayList(maxPlayers); disconnectedPlayerControllers = new ArrayList(maxPlayers); userNameSet = new HashSet<string>(); levels = new ArrayList(maxPlayers); for (int i = 0; i < maxPlayers; i++) { lobbyPlayerArray.Add(null); gameplayerControllers.Add(null); disconnectedPlayerControllers.Add(null); levels.Add(LevelEnum.Unselected); } lobbySystemStartSetting(); citizenshipZeroTime = 0; //StartCoroutine(startLatency()); //infoPanel.DisplayDisconnectError("Client error : ", StopClientClbk, ReconnectClinetClbk); }
/// <summary> /// Constructor /// </summary> /// <param name="title"> Question title. </param> /// <param name="answer"> Question answer. </param> /// <param name="options"> Question options. </param> /// <param name="level"> Question level. </param> public Question(string title, Option answer, List <Option> options, LevelEnum level) { this.Title = title; this.Answer = answer; this.Options = options; this.Level = level; }
//切换场景方法供外部调用 public void ChangeLevel(LevelEnum levelType) { string sceneName = ""; switch (levelType) { case LevelEnum.Event: { sceneName = "Game"; StartCoroutine(LoadLevelScene(levelType, sceneName, true)); } break; case LevelEnum.Main: { sceneName = "Demo"; if (_bEventStarted) { StartCoroutine(UnloadAdditiveLevelScene(levelType, "Game")); } else { StartCoroutine(LoadLevelScene(levelType, sceneName)); } } break; } }
/// <summary> /// Switches to level. /// </summary> /// <param name="level">The level.</param> private void SwitchToLevel(LevelEnum level) { switch (level) { case LevelEnum.Start: this.CurrentCamera = new Camera(GameManager.Instance.GraphicsDevice.Viewport, CameraType.Screen); _currentLevel = Level.Start(); break; case LevelEnum.Level1: this.CurrentCamera = new Camera(GameManager.Instance.GraphicsDevice.Viewport, CameraType.Follow); _currentLevel = Level.Level_1(); break; case LevelEnum.Level2: this.CurrentCamera = new Camera(GameManager.Instance.GraphicsDevice.Viewport, CameraType.Follow); _currentLevel = Level.Level_2(); break; case LevelEnum.Credits: this.CurrentCamera = new Camera(GameManager.Instance.GraphicsDevice.Viewport, CameraType.Screen); _currentLevel = Level.Credits(); break; } }
public static void RemoveFriendItemsDueToBlock(LevelEnum level, Guid ofReferenceId, Guid byReferenceId, Guid byAppUserId) { ApplicationDbContext db = new ApplicationDbContext(); RemoveFriendItemsDueToBlock(db, level, ofReferenceId, byReferenceId, byAppUserId); db.Dispose(); }
private Level(string foregroundPath, string backgroundPath, string backBackGroundName, LevelEnum levelEnum) { // Set up BackBackGround this.BackBackGroundName = backBackGroundName; this.BackgroundTexture = GameManager.Instance.Content.Load <Texture2D>($@"BackBackground\{BackBackGroundName}"); this.BackgroundFrame = new Rectangle(0, 0, GameManager.Instance.GraphicsDevice.Viewport.Width, GameManager.Instance.GraphicsDevice.Viewport.Height); // Set up Paths this.ForegroundPath = Environment.CurrentDirectory + foregroundPath; this.BackgroundPath = Environment.CurrentDirectory + backgroundPath; // Load Foreground Entities this.ForegroundEntities = BuildLevelMapOffOfCSVFile(this.ForegroundPath); // Get Player Start Position this.PlayerStart = this.ForegroundEntities.First(entity => entity?.CollisionComponent?.Tag == Tags.PlayerStart); this.PlayerEntity = new PlayerEntity(); MovePlayerToStartPosition(); // Load Background Entities this.BackgroundEntities = BuildLevelMapOffOfCSVFile(this.BackgroundPath); // Create List of Temp Entites this.TempEntities = new Dictionary <int, Entity>(); this.ToDelete = new List <Entity>(); this.Enum = levelEnum; }
public void CadFuncao() { Console.WriteLine("####################### Cadastro de Função #######################"); Console.WriteLine(" 1 - Junior | 2 - Pleno | 3 - Sênior "); Console.Write("Níveis: "); int level = Convert.ToInt32(Console.ReadLine()); switch (level) { case 1: level = (int)LevelEnum.Junior; break; case 2: level = (int)LevelEnum.Pleno; break; case 3: level = (int)LevelEnum.Senior; break; default: throw new Exception("Valor digitado é inválido."); } LevelEnum level1 = (LevelEnum)level; Console.Write("Valor hora: "); var vlrHora = Convert.ToDouble(Console.ReadLine()); funcaoRepository.SalvarFuncao(level1, vlrHora); }
//################################################################################## // General functions //################################################################################## private void Start() { m_LevelEnum = LevelEnum.Level_1; m_sText = ""; SetDisplayText(); }
private void Print(string a_sText, bool a_bIsHeader, LevelEnum a_eLevel) { if (a_eLevel <= Log.CurrentLevel) { LogWriter?.Write(GenerateLogShiftLine(a_sText, a_bIsHeader, a_eLevel)); } }
//加载场景 private IEnumerator LoadLevelScene(LevelEnum levelType, string name, bool additive = false) { CleanCurrentLevel(); int loadingProgress = 0; //SceneManager.LoadSceneAsync("Loading"); AsyncOperation oprAsync = additive ? SceneManager.LoadSceneAsync(name, LoadSceneMode.Additive) : SceneManager.LoadSceneAsync(name); oprAsync.allowSceneActivation = false; while (!oprAsync.isDone)//done这个变量在allowSceneActivation为true以后自然会设置 { int progressLimit = 0; if (oprAsync.progress < 0.85f)//unity的机制是卡在0.9,防止浮点数不准确,写0.85 { progressLimit = (int)(oprAsync.progress * 100); } else { progressLimit = 100; } if (loadingProgress <= progressLimit) { loadingProgress += 2;//这个阶段速度可以控制 } else if (progressLimit == 100) { oprAsync.allowSceneActivation = true; } yield return(new WaitForEndOfFrame()); } //!!很关键 SceneManager.SetActiveScene(SceneManager.GetSceneByName(name)); LoadLevelLogic(levelType); oprAsync = null; }
public static List <BlobStatsData> GetLevelEnemies(LevelEnum levelEnum) { List <BlobStatsData> blobStatsDatas = new List <BlobStatsData>(); switch (levelEnum) { case LevelEnum.TestingGround: blobStatsDatas.Add(BlobInstantiator.CreateBlob(BlobType.Fighter)); break; case LevelEnum.IntroLevel1: // No enemies on this level break; case LevelEnum.IntroLevel2: blobStatsDatas.Add(BlobInstantiator.CreateBlob(BlobType.Survivor)); break; case LevelEnum.IntroLevel3: blobStatsDatas.Add(BlobInstantiator.CreateBlob(BlobType.Fighter)); break; default: Debug.LogError("LevelEnemyInfo was not found."); break; } return(blobStatsDatas); }
/// <summary> /// Initializes a new instance of the <see cref="Error" /> class. /// </summary> /// <param name="Code">Code (required).</param> /// <param name="Level">Level (required).</param> /// <param name="Cause">Cause.</param> /// <param name="Message">Message (required).</param> public Error(string Code = default(string), LevelEnum Level = default(LevelEnum), Error Cause = default(Error), string Message = default(string)) { // to ensure "Code" is required (not null) if (Code == null) { throw new InvalidDataException("Code is a required property for Error and cannot be null"); } else { this.Code = Code; } // to ensure "Level" is required (not null) if (Level == null) { throw new InvalidDataException("Level is a required property for Error and cannot be null"); } else { this.Level = Level; } // to ensure "Message" is required (not null) if (Message == null) { throw new InvalidDataException("Message is a required property for Error and cannot be null"); } else { this.Message = Message; } this.Cause = Cause; }
public static bool IsReferenceInGroupForType(Guid groupId, LevelEnum referenceLevel, Guid referenceId) { ApplicationDbContext db = new ApplicationDbContext(); bool inGroup = IsReferenceInGroupForType(db, groupId, referenceLevel, referenceId); db.Dispose(); return(inGroup); }
public static List <Group> GetGroupsForTypeAndReferenceId(LevelEnum referenceLevel, Guid referenceId) { ApplicationDbContext db = new ApplicationDbContext(); List <Group> list = GetGroupsForTypeAndReferenceId(db, referenceLevel, referenceId); db.Dispose(); return(list); }
public static Block CreateBlock(LevelEnum level, Guid ofReferenceId, Guid byReferenceId, Guid byAppUserId) { ApplicationDbContext db = new ApplicationDbContext(); Block block = CreateBlock(db, level, ofReferenceId, byReferenceId, byAppUserId); db.Dispose(); return(block); }
public static Block GetBlockForReferenceIdAndType(ApplicationDbContext db, LevelEnum referenceLevel, Guid ofReferenceId, Guid byReferenceId) { Block block = (from b in db.Blocks where (b.Type == referenceLevel && b.BlockedOfId == ofReferenceId && b.BlockedById == byReferenceId) select b).FirstOrDefault(); return(block); }
public static List <BlockView> GetBlockViewByType(Guid appUserId, LevelEnum type) { ApplicationDbContext db = new ApplicationDbContext(); List <BlockView> list = GetBlockViewByType(db, appUserId, type); db.Dispose(); return(list); }
public static bool IsReferenceBlocked(LevelEnum referenceLevel, Guid ofReferenceId, Guid byReferenceId) { ApplicationDbContext db = new ApplicationDbContext(); bool blocked = IsReferenceBlocked(db, referenceLevel, ofReferenceId, byReferenceId); db.Dispose(); return(blocked); }
public static Block GetBlockForReferenceIdAndType(LevelEnum referenceLevel, Guid ofReferenceId, Guid byReferenceId) { ApplicationDbContext db = new ApplicationDbContext(); Block block = GetBlockForReferenceIdAndType(db, referenceLevel, ofReferenceId, byReferenceId); db.Dispose(); return(block); }
public void SendLevelInfo(LevelEnum le) { if (localLobbyPlayer != null) { localLobbyPlayer.CmdSetLevelWithSlot(le); //SetLevelInfo(le); } }
public Manager(GameCanvas playGrid) { const LevelEnum currentLevelEnum = LevelEnum.LevelOne; _player = new Player(); LevelFactory.CurrentLevel = LevelFactory.CreateLevel(currentLevelEnum, playGrid, _player); LevelFactory.CurrentLevel.InitLevel(); }
public static UserAction CreateActionForFriendRequestFromUser(LevelEnum level, Guid ofReferenceId, Guid byReferenceId) { ApplicationDbContext db = new ApplicationDbContext(); UserAction action = CreateActionForFriendRequestFromUser(db, level, ofReferenceId, byReferenceId); db.Dispose(); return(action); }
public static UserAction CreateAction(ActionTypeEnum actionType, LevelEnum level, string actionDescription, Guid referenceKey, Guid createdBy, DateTime createdOn, EntityStatusEnum status) { ApplicationDbContext db = new ApplicationDbContext(); UserAction action = CreateAction(db, actionType, level, actionDescription, referenceKey, createdBy, createdOn, status); db.Dispose(); return(action); }
/// <summary> /// /// </summary> /// <param name="message"></param> /// <param name="level"></param> /// <param name="father"></param> /// <param name="del">已查阅事件,在日志被删除之后调用</param> public LogMessage(String message, LevelEnum level, StackPanel father, CheckDel del = null) { InitializeComponent(); Message = message; Level = level; Father = father; CheckEvent = del; }
private void OnEnable() { nextLevel = LevelManager.GetLevelEnum(SceneManager.GetActiveScene().name); if (!LevelManager.IsNextLevelUnlocked(nextLevel)) { nextLevelButton.interactable = false; } }
public static bool IsReferenceInGroup(LevelEnum referenceLevel, Guid ofReferenceId, Guid byReferenceId) { ApplicationDbContext db = new ApplicationDbContext(); bool inGroup = IsReferenceInGroup(db, referenceLevel, ofReferenceId, byReferenceId); db.Dispose(); return(inGroup); }
public static Friend GetFriendRequestForReferenceIdAndType(LevelEnum referenceLevel, Guid ofReferenceId, Guid byReferenceId) { ApplicationDbContext db = new ApplicationDbContext(); Friend friendRequest = GetFriendRequestForReferenceIdAndType(db, referenceLevel, ofReferenceId, byReferenceId); db.Dispose(); return(friendRequest); }
public void ChangeLevel(LevelEnum level) { int levelIndex = (int)level; Debug.Log("Windows Debug: Loading Level " + levelIndex); SceneManager.LoadScene(levelIndex); }
public void switchLevel(LevelEnum levelEnum, int id) { pauseTime = 30; level.removeEntityImmediately(player); level = Level.LoadLevel(this, levelEnum); level.findSpawn(id); player.x = level.xSpawn; player.z = level.ySpawn; ((LadderBlock) level.getBlock(level.xSpawn, level.ySpawn)).wait = true; player.x += Math.Sin(player.rot) * 0.2; player.z += Math.Cos(player.rot) * 0.2; level.addEntity(player); }
public static Level LoadLevel(Game game, LevelEnum levelEnum) { Level level; if (!loaded.TryGetValue(levelEnum, out level)) { System.Drawing.Bitmap levelMap = null; Type levelType = null; switch (levelEnum) { case LevelEnum.Crypt: levelMap = global::com.mojang.escape.Properties.Resources.crypt; levelType = typeof(CryptLevel); break; case LevelEnum.Dungeon: levelMap = global::com.mojang.escape.Properties.Resources.dungeon; levelType = typeof(DungeonLevel); break; case LevelEnum.Ice: levelMap = global::com.mojang.escape.Properties.Resources.ice; levelType = typeof(IceLevel); break; case LevelEnum.Overworld: levelMap = global::com.mojang.escape.Properties.Resources.overworld; levelType = typeof(OverworldLevel); break; case LevelEnum.Start: levelMap = global::com.mojang.escape.Properties.Resources.start; levelType = typeof(StartLevel); break; case LevelEnum.Temple: levelMap = global::com.mojang.escape.Properties.Resources.temple; levelType = typeof(TempleLevel); break; } int w = levelMap.Width; int h = levelMap.Height; int[] pixels = new int[w * h]; for (int y = 0; y < h; ++y) { for (int x = 0; x < w; ++x) { pixels[x + y * w] = levelMap.GetPixel(x, y).ToArgb(); } } level = levelType.GetConstructor(new Type[] { }).Invoke(new object[] { }) as Level; level.init(game, w, h, pixels); loaded.Add(levelEnum, level); } return level; }
public void CmdSetLevelWithSlot(LevelEnum le) { NetworkManagerCustom.SingletonNM.SetLevelWithSlot(le, slot); }
public void SetLevelInfo(LevelEnum le) { warningText.text = "You have selected Level " + le.ToString(); }
IEnumerator CheckLevelSelect() { while (true) { //Debug.Log("CheckLevelSelect"); //string debuglog = "CheckLevelSelect "; //TODO: bug LevelEnum firstLevel = LevelEnum.Easy; bool isAllSame = false; bool isFirst = true; bool isAllSelected = false; int userCount = 0; for (int i = 0; i < maxPlayers; i++) { if (lobbyPlayerArray[i] != null) { LevelEnum curr = (LevelEnum)levels[i]; userCount++; //debuglog += curr + " "; if (isFirst) { isAllSame = true; isAllSelected = true; firstLevel = curr; //Debug.Log("Level Select Same " + firstLevel.ToString()); isFirst = false; isAllSame &= (firstLevel != LevelEnum.Unselected); isAllSelected &= (firstLevel != LevelEnum.Unselected); } else { isAllSame &= (firstLevel == curr); isAllSelected &= (curr != LevelEnum.Unselected); } } else { //debuglog += " null "; } } //debuglog += " allSame " + isAllSame + " allselected " + isAllSelected; //Debug.Log(debuglog); if (userCount < minPlayers) { yield return new WaitForSeconds(0.2f); continue; } if (isAllSame) { Debug.Log("Level Select Same"); selectedDifficulty = firstLevel; StartCoroutine("CheckLobbyReady"); ChangeToLobbyPanel(); } else if(isAllSelected) { Debug.Log("Level Select Not Same"); foreach(LobbyPlayer lp in lobbyPlayerArray) { if (lp != null) { lp.RpcLevelNotSame(); } } for(int i = 0; i < maxPlayers; i++) { levels[i] = LevelEnum.Unselected; } } yield return new WaitForSeconds(0.2f); } }
public void SetLevelWithSlot(LevelEnum le, int newSlot) { Debug.Log("SetLevelWithSlot"); if (newSlot >=0 && newSlot < maxPlayers) { //Debug.Log("Set Level " + le.ToString() + " " + newSlot); levels[newSlot] = le; } }