public Gods CreateGods(Gods gods) { int id = _db.ExecuteScalar <int>(@"INSERT INTO gods (name, img, description) VALUES (@Name, @Img, @Description); SELECT LAST_INSERT_ID();", gods); gods.Id = id; return(gods); }
public ActionResult <Gods> Post([FromBody] Gods gods) { try { return(Ok(_repository.CreateGods(gods))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ArmyUnit(ArmyUnits p_Name, int p_Population, int p_Capacity, Gods p_God, bool p_IsFromBarracks, bool p_IsResearched, int p_Wood, int p_Stone, int p_Iron, int p_Favor, int p_TempleLvlReq, int p_BarracksLvlReq, int p_DocksLvlReq) { Name = p_Name; Population = p_Population; Capacity = p_Capacity; God = p_God; IsFromBarracks = p_IsFromBarracks; IsResearched = p_IsResearched; Wood = p_Wood; Stone = p_Stone; Iron = p_Iron; Favor = p_Favor; TempleLvlReq = p_TempleLvlReq; BarracksLvlReq = p_BarracksLvlReq; DocksLvlReq = p_DocksLvlReq; }
public static void SelectGod(Gods god, bool loadSong = true, bool sameSong = false) { if (!sameSong) { int oldSongID = songID; while (songID == oldSongID || (lastID >= 0 && lastID == songID)) { songID = Random.Range(0, 5); } firstPlay = true; lastID = oldSongID; } selectedGod = god; switch(god) { case Gods.RHINO: shockMag = 0.05f; beat = 0.6666f; mainColor = new Color(0,185.0f/255.0f, 1.0f); secondaryColor = new Color(0,1.0f, 91.0f / 255.0f); godColors = new Color[]{ new Color(0,185.0f/255.0f, 1.0f), new Color(0,1.0f, 91.0f / 255.0f), new Color(144.0f / 255.0f,0.0f, 1.0f), }; if (loadSong) { StartLoading(rhinoSongs[songID]); } wiggleSpace = 0.1f; godIndex = 0; break; case Gods.BEAR: shockMag = 0.04f; beat = 0.48f; mainColor = new Color(1,135.0f/255.0f, 0.0f); secondaryColor = new Color(1.0f,0.0f, 110.0f / 255.0f); godColors = new Color[]{ new Color(1.0f, 135.0f / 255.0f, 0.0f), new Color(1.0f, 0, 110.0f / 255.0f), new Color(1.0f, 212.0f / 255.0f, 0.0f) }; wiggleSpace = 0.08f; if (loadSong) { //song = Resources.Load<AudioClip>(bearSongs[songID]); StartLoading(bearSongs[songID]); } godIndex = 1; break; case Gods.BULL: shockMag = 0.035f; beat = 0.375f; mainColor = new Color(1,0, 66.0f / 255.0f); secondaryColor = new Color(144.0f / 255.0f,0.0f, 1.0f); godColors = new Color[]{ new Color(1.0f,0,66.0f / 255.0f), new Color(0,206.0f / 255.0f,229.0f / 255.0f), new Color(144.0f / 255.0f,0,1.0f), }; if(loadSong) { //song = Resources.Load<AudioClip>(bullSongs[songID]); StartLoading(bullSongs[songID]); } wiggleSpace = 0.069f; godIndex = 2; break; } }