public void Test1() { IGodClass god = new GodClass(); var tst = "abcdefgh"; Assert.Equal(tst, god.Echo(tst)); }
public void InitFromJSON(String text) { JObject testJson = JObject.Parse(text); attackSpeed = (double)testJson["attackSpeed"]; moveSpeed = (double)testJson["moveSpeed"]; spriteImage = (string)testJson["spriteImage"]; attackPwr = (int)testJson["attackPwr"]; maxHealth = (int)testJson["maxHealth"]; attackRange = (int)testJson["attackRange"]; aggroRange = (int)testJson["aggroRange"]; colorName = (string)testJson["color"]; if (testJson.ContainsKey("armor")) { armor = (double)testJson["armor"]; } else { armor = 0; } /* * if (testJson.ContainsKey("fillColor")) * { * fillColorName = (string)testJson["fillColor"]; * drawColor = ConvertStringToColor(fillColorName); * } */ if (testJson.ContainsKey("sprite")) { string spriteName = (string)testJson["sprite"]; if (testJson.ContainsKey("animations")) { animManager = new AnimationManager(spriteName, testJson); } else { animManager = new AnimationManager(spriteName); } this.AddChild(animManager); animManager.Play("move"); } if (testJson.ContainsKey("abilities")) { JArray abilities = (JArray)testJson["abilities"]; foreach (JObject ability in abilities) { string abilityName = (string)ability["actionName"]; JObject compileTimeArgs = (JObject)ability["compileTimeArgs"]; CardAct tempAction = GodClass.GetAction(abilityName, compileTimeArgs); this.abilityList.Add(tempAction); } } }
public async Task <List <AntiPatternBase> > DetectAsync(Solution roslynSolution) { var godClass = new GodClass(); await godClass.ExtractFromRoslynSolutionAsync(roslynSolution); List <DetectionRule> detectionRules = new DetectionRuleFactory <T>().GetDetectionRules(); var detectedAntiPatterns = new List <AntiPatternBase>(); foreach (var modelTree in godClass.ORMModelTrees) { foreach (var detectionRule in detectionRules) { if (detectionRule.AppliesToModelTree(modelTree)) { detectedAntiPatterns.AddRange(detectionRule.DetectedAntiPatterns); } } } return(detectedAntiPatterns); }
private void ExecuteAction(MsgStruct msg) { int teamColor; //Parse actions switch (msg.type) { case MsgType.PlayCard: Debug.WriteLine("Play Card: " + msg.Message); string[] args = msg.Message.Split(';'); if (args.Length > 1) { string cardName = args[0]; int.TryParse(args[1], out teamColor); GodClass.PlayCard(cardName, new int[] { teamColor }); } break; default: break; } }
public void LogicInit(String text) { JObject cardJson = JObject.Parse(text); cardTitle = (string)cardJson["cardTitle"]; cardText = (string)cardJson["cardText"]; cardImage = (string)cardJson["cardImage"]; cardCost = (int)cardJson["cardCost"]; if (cardJson.ContainsKey("cardTiming")) { cardTiming = ((string)cardJson["cardTiming"]).ToLower() == "immediate" ? CardTimeOpts.Immediate : CardTimeOpts.Queued; } JArray cardActions = (JArray)cardJson["cardActions"]; foreach (JObject cardAction in cardActions) { string cardName = (string)cardAction["actionName"]; JObject compileTimeArgs = (JObject)cardAction["compileTimeArgs"]; CardAct tempAction = GodClass.GetAction(cardName, compileTimeArgs); this.cardActionList.Add(tempAction); } }
private void InitGame() { this.cardHUD = new CardHUD(0, 0, (int)GodClass.CardHUDdimensions.GetHeight(), (int)GodClass.CardHUDdimensions.GetWidth(), this.gameplayLayer); this.cardHistory = new CardHistory((int)(GodClass.BattlefieldDimensions.GetWidth() * 0.4) , (int)(BattlefieldDimensions.GetHeight() * 0.95) , (int)(GodClass.BattlefieldDimensions.GetHeight()) , (int)GodClass.BattlefieldDimensions.GetWidth() , this.gameplayLayer); this.battlefield = new UIcontainer(0, (int)GodClass.CardHUDdimensions.GetHeight(), (int)GodClass.BattlefieldDimensions.GetHeight(), (int)GodClass.BattlefieldDimensions.GetWidth(), this.gameplayLayer); GodClass.battlefield = battlefield; GodClass.cardHUD = this.cardHUD; GodClass.cardHistory = this.cardHistory; gameplayLayer.AddChild(battlefield); gameplayLayer.AddChild(cardHUD); gameplayLayer.AddChild(cardHistory); targetLines = new List <CCDrawNode>(); GodClass.gameplayLayer = gameplayLayer; GodClass.hudLayer = hudLayer; GodClass.InitLibrary(); InitGridManager(); this.InitTeams(); //InitScrollMap(); GamesState = GameState.Playing; }
public void SetClass(string classStr) { //Debug.Log(classStr); if (classStr.Contains("Mage")) { godClass = GodClass.Mage; } if (classStr.Contains("Warrior")) { godClass = GodClass.Warrior; } if (classStr.Contains("Hunter")) { godClass = GodClass.Hunter; } if (classStr.Contains("Guardian")) { godClass = GodClass.Guardian; } if (classStr.Contains("Assassin")) { godClass = GodClass.Assassin; } }
public void Test3() { IGodClass god = new GodClass(); Assert.Null(god.Zzz()); }
public void Test4() { IGodClass god = new GodClass(); Assert.Equal(0, god.Yyy()); }
public void Test2() { IGodClass god = new GodClass(); Assert.Equal(42, god.SuperMethod()); }