private static int CastSkill(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 12); FightLogic fightLogic = (FightLogic)ToLua.CheckObject(L, 1, typeof(FightLogic)); GameObject go = (GameObject)ToLua.CheckUnityObject(L, 2, typeof(GameObject)); int skillId = (int)LuaDLL.luaL_checknumber(L, 3); int skillType = (int)LuaDLL.luaL_checknumber(L, 4); int stamp = (int)LuaDLL.luaL_checknumber(L, 5); string folderName = ToLua.CheckString(L, 6); string prefabName = ToLua.CheckString(L, 7); string target_id = ToLua.CheckString(L, 8); Vector3 targetPos = ToLua.ToVector3(L, 9); bool needneedFeedback = LuaDLL.luaL_checkboolean(L, 10); string[] targetIds = ToLua.CheckStringArray(L, 11); bool isAct = LuaDLL.luaL_checkboolean(L, 12); GameObject obj = fightLogic.CastSkill(go, skillId, skillType, stamp, folderName, prefabName, target_id, targetPos, needneedFeedback, targetIds, isAct); ToLua.Push(L, obj); result = 1; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
public HttpResponseMessage AllFightList([FromBody] RankParameterModel rank) { FightLogic fightLogic = new FightLogic(); jsonResult = fightLogic.AllFightList(rank); returnResult.Content = new StringContent(jsonResult, Encoding.UTF8, "application/json"); return(returnResult); }
public HttpResponseMessage UpdateGameID([FromBody] FightParameter2Model fight) { FightLogic fightLogic = new FightLogic(); jsonResult = fightLogic.UpdateGameID(fight); returnResult.Content = new StringContent(jsonResult, Encoding.UTF8, "application/json"); return(returnResult); }
static void Main(string[] args) { var fight = new FightLogic(); var addCharacter = new CharacterLogic(); fight.Start(); //addCharacter.CreateCharacter(); Console.ReadKey(); }
private static ExpeditionLogic ObtainExpeditionLogic(GameState agameState = null) { var randomProvider = new RandomProvider(); var gameState = agameState ?? new GameState(); var unitLogic = new UnitLogic(gameState, randomProvider); var fightLogic = new FightLogic(randomProvider, unitLogic); var expeditionLogic = new ExpeditionLogic(randomProvider, unitLogic, fightLogic); return(expeditionLogic); }
// Use this for initialization void Start() { if (instance == null) { instance = this; Debug.Log("Initializing..."); allLogics = GameObject.FindObjectsOfType <FightLogic>(); haveBeenHit = new bool[allLogics.Length]; Debug.Log("All logic objects found. There are " + allLogics.Length + " objects."); } }
// Use this for initialization void Start() { Instance = this; EventQueue = new EventQueue(); string name = CurUserName; UserLogic = GameObject.Find("UserAgent").GetComponent <UserLogic>(); MenuLogic = GameObject.Find("MenuAgent").GetComponent <MenuLogic>(); LoginLogic = GameObject.Find("LoginAgent").GetComponent <LoginLogic>(); BuildLogic = GameObject.Find("BuildAgent").GetComponent <BuildLogic>(); SearchLogic = GameObject.Find("SearchAgent").GetComponent <SearchLogic>(); FightLogic = GameObject.Find("FightAgent").GetComponent <FightLogic>(); }
private static int GetCanCastSkill(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 0); bool canCastSkill = FightLogic.GetCanCastSkill(); LuaDLL.lua_pushboolean(L, canCastSkill); result = 1; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
private static int SkillBtnClick(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 1); FightLogic fightLogic = (FightLogic)ToLua.CheckObject(L, 1, typeof(FightLogic)); fightLogic.SkillBtnClick(); result = 0; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
private static int GetInstance(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 0); FightLogic instance = FightLogic.GetInstance(); ToLua.Push(L, instance); result = 1; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
private static int CancelMove(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 2); FightLogic fightLogic = (FightLogic)ToLua.CheckObject(L, 1, typeof(FightLogic)); SceneEntity obj = (SceneEntity)ToLua.CheckUnityObject(L, 2, typeof(SceneEntity)); fightLogic.CancelMove(obj); result = 0; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
private static int GetTargetHurtPos(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 2); FightLogic fightLogic = (FightLogic)ToLua.CheckObject(L, 1, typeof(FightLogic)); SceneEntity target = (SceneEntity)ToLua.CheckUnityObject(L, 2, typeof(SceneEntity)); Vector3 targetHurtPos = fightLogic.GetTargetHurtPos(target); ToLua.Push(L, targetHurtPos); result = 1; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
private static int GetSkillTargetPos(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 4); int tx = (int)LuaDLL.luaL_checknumber(L, 1); int ty = (int)LuaDLL.luaL_checknumber(L, 2); string axyz = ToLua.CheckString(L, 3); SceneEntity obj = (SceneEntity)ToLua.CheckUnityObject(L, 4, typeof(SceneEntity)); Vector3 skillTargetPos = FightLogic.GetSkillTargetPos(tx, ty, axyz, obj); ToLua.Push(L, skillTargetPos); result = 1; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
private static int SkillRunToTarget(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 5); FightLogic fightLogic = (FightLogic)ToLua.CheckObject(L, 1, typeof(FightLogic)); SceneEntity attacker = (SceneEntity)ToLua.CheckUnityObject(L, 2, typeof(SceneEntity)); GameObject targetGo = (GameObject)ToLua.CheckUnityObject(L, 3, typeof(GameObject)); float radius = (float)LuaDLL.luaL_checknumber(L, 4); bool needDash = LuaDLL.luaL_checkboolean(L, 5); fightLogic.SkillRunToTarget(attacker, targetGo, radius, needDash); result = 0; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
private static int SetSkillInfo(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 5); FightLogic fightLogic = (FightLogic)ToLua.CheckObject(L, 1, typeof(FightLogic)); GameObject obj = (GameObject)ToLua.CheckUnityObject(L, 2, typeof(GameObject)); GameObject skill = (GameObject)ToLua.CheckUnityObject(L, 3, typeof(GameObject)); int skillType = (int)LuaDLL.luaL_checknumber(L, 4); bool showEff = LuaDLL.luaL_checkboolean(L, 5); fightLogic.SetSkillInfo(obj, skill, skillType, showEff); result = 0; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }