本文整理汇总了C#中LuaTable.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# LuaTable.ContainsKey方法的具体用法?C# LuaTable.ContainsKey怎么用?C# LuaTable.ContainsKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LuaTable
的用法示例。
在下文中一共展示了LuaTable.ContainsKey方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleBestRecordMessage
public void HandleBestRecordMessage(LuaTable luaTable)
{
if (luaTable.ContainsKey("1")
&& luaTable.ContainsKey("2")
&& luaTable.ContainsKey("3"))
{
string name = Convert.ToString(luaTable["1"]);
string score = string.Concat(Convert.ToString(luaTable["2"]), LanguageData.GetContent(7102));
int vocation = Convert.ToInt32(luaTable["3"]);
string vocationStr = LanguageData.GetContent(vocation);
// 复用了时分秒的分
// InstanceLevelChooseUIViewManager.Instance.SetInstanceLevelChooseUIPlayerNO1(true, name, score, vocationStr);
InstanceLevelChooseUIViewManager.Instance.SetInstanceLevelChooseUIPlayerNO1(false);
}
else
{
InstanceLevelChooseUIViewManager.Instance.SetInstanceLevelChooseUIPlayerNO1(false);
}
}
示例2: MissionResp
//.........这里部分代码省略.........
}
else
{
OnNotifyToClientResultSuccessResp(luaTable);
}
break;
case (byte)MissionReq.NOTIFY_TO_CLIENT_RESULT_FAILED:
LoggerHelper.Debug("NOTIFY_TO_CLIENT_RESULT_FAILED");
OnNotifyToClientResultFailedResp();
break;
case (byte)MissionReq.GET_MISSION_REWARDS:
LoggerHelper.Debug("GET_MISSION_REWARDS");
if (MapData.dataMap.Get(MogoWorld.thePlayer.sceneId).type == MapType.ClimbTower)
{
return;
}
OnGetMissionRewardResp(luaTable);
break;
case (byte)MissionReq.CLIENT_MISSION_INFO:
LoggerHelper.Debug("CLIENT_MISSION_INFO");
string result = (string)luaTable["1"];
OnUpdateMissionGearInfo(result);
break;
case (byte)MissionReq.KILL_MONSTER_EXP:
LoggerHelper.Debug("KILL_MONSTER_EXP");
Dictionary<int, int> data;
if (Utils.ParseLuaTable(luaTable, out data))
{
if (data.ContainsKey(1))
{
BillboardLogicManager.Instance.AddAloneBattleBillboard(MogoWorld.thePlayer.Transform.position, data[1], AloneBattleBillboardType.Exp);
}
}
break;
case (byte)MissionReq.QUIT_MISSION:
LoggerHelper.Debug("QUIT_MISSION");
break;
case (byte)MissionReq.NOTIFY_TO_CLENT_SPAWNPOINT:
LoggerHelper.Debug("NOTIFY_TO_CLENT_SPAWNPOINT");
int preID = Convert.ToInt32(luaTable["1"]);
EventDispatcher.TriggerEvent(Events.GearEvent.SpawnPointDead, preID);
break;
case (byte)MissionReq.UPLOAD_COMBO:
LoggerHelper.Debug("UPLOAD_COMBO");
break;
case (byte)MissionReq.GET_MISSION_TRESURE_REWARDS:
LoggerHelper.Debug("GET_MISSION_TRESURE_REWARDS: " + luaTable.ToString());
if (Utils.ParseLuaTable(luaTable, out chestData))
CheckChestState(chestData);
break;
case (byte)MissionReq.REVIVE:
LoggerHelper.Debug("REVIVE");
OnAvatarRebornResp(luaTable);
break;
case (byte)MissionReq.GET_REVIVE_TIMES:
示例3: OnGetSweepMissionResp
void OnGetSweepMissionResp(LuaTable luaTable)
{
TimerHeap.AddTimer(1000, 0, () =>
{
SweepMissionRepostData sweepMissionRepostData = new SweepMissionRepostData();
// 怪物信息
object enemyObj;
sweepMissionRepostData.Enemys = new Dictionary<int, int>();
if (Utils.ParseLuaTable((LuaTable)luaTable["1"], typeof(Dictionary<int, int>), out enemyObj))
{
sweepMissionRepostData.Enemys = enemyObj as Dictionary<int, int>;
foreach (KeyValuePair<int, int> pair in sweepMissionRepostData.Enemys)
{
LoggerHelper.Debug("monsterId = " + pair.Key + " , " + "monsterCount = " + pair.Value);
}
}
// 物品信息
object itemObj;
sweepMissionRepostData.Items = new Dictionary<int, int>();
if (Utils.ParseLuaTable((LuaTable)luaTable["2"], typeof(Dictionary<int, int>), out itemObj))
{
sweepMissionRepostData.Items = itemObj as Dictionary<int, int>;
foreach (KeyValuePair<int, int> pair in sweepMissionRepostData.Items)
{
LoggerHelper.Debug("ItemId = " + pair.Key + " , " + "ItemCount = " + pair.Value);
}
}
if (luaTable.ContainsKey("3"))
sweepMissionRepostData.gold = Convert.ToInt32(luaTable["3"]);
if (luaTable.ContainsKey("4"))
sweepMissionRepostData.exp = Convert.ToInt32(luaTable["4"]);
InstanceUILogicManager.Instance.OpenMonsterReport(sweepMissionRepostData);
});
}
示例4: OnBuiltClientMissionRewardPool
protected void OnBuiltClientMissionRewardPool(LuaTable luaTable)
{
Dictionary<int, int> item = new Dictionary<int, int>();
int money = 0;
int exp = 0;
if (luaTable.ContainsKey("2"))
money = Convert.ToInt32(luaTable["2"]);
if (luaTable.ContainsKey("3"))
exp = Convert.ToInt32(luaTable["3"]);
if (luaTable.ContainsKey("1"))
Utils.ParseLuaTable<Dictionary<int, int>>((LuaTable)luaTable["1"], out item);
Mogo.GameLogic.LocalServer.LocalServerSceneManager.Instance.InitSrvPreCollect(item, money, exp);
}
示例5: HandleClientMissionWonData
public void HandleClientMissionWonData(LuaTable luaTable)
{
Dictionary<int, int> items = new Dictionary<int, int>();
int money = 0;
int exp = 0;
int time = 0;
int starNum = 0;
int scorePoint = 0;
int minutes = 0;
int second = 0;
cards.Clear();
itemPool.Clear();
if (luaTable.ContainsKey("2"))
money = Convert.ToInt32(luaTable["2"]);
if (luaTable.ContainsKey("3"))
exp = Convert.ToInt32(luaTable["3"]);
if (luaTable.ContainsKey("4"))
{
time = Convert.ToInt32(luaTable["4"]);
minutes = time / 60;
second = time % 60;
}
if (luaTable.ContainsKey("5"))
starNum = Convert.ToInt32(luaTable["5"]);
if (luaTable.ContainsKey("6"))
scorePoint = Convert.ToInt32(luaTable["6"]);
InstanceUILogicManager.Instance.SetNewPassMessage(minutes, second, MogoWorld.thePlayer.GetMaxCombo(), scorePoint, starNum > 4 ? 4 : starNum);
theOwner.ResetMaxCombo();
if (luaTable.ContainsKey("1"))
{
if (Utils.ParseLuaTable<Dictionary<int, int>>((LuaTable)luaTable["1"], out items))
{
if (items != null)
{
List<ItemParent> theItems = new List<ItemParent>();
List<int> ids = new List<int>();
List<int> counts = new List<int>();
foreach (KeyValuePair<int, int> item in items)
{
var temp = ItemParentData.GetItem(item.Key);
if (temp != null)
{
ids.Add(temp.id);
counts.Add(item.Value);
LoggerHelper.Debug("mission reward item : ItemID = " + item.Key + ", ItemCount = " + item.Value);
}
}
if (money > 0)
{
ids.Add(2);
counts.Add(money);
}
if (exp > 0)
{
ids.Add(1);
counts.Add(exp);
}
// InstanceUILogicManager.Instance.SetInstanceRewardUIReward(ids, counts, itemNames);
InstanceUILogicManager.Instance.SetNewInstanceRewardUIReward(ids, counts);
}
}
}
if (luaTable.ContainsKey("7"))
{
List<Dictionary<int, int>> cardItems;
Utils.ParseLuaTable<List<Dictionary<int, int>>>((LuaTable)luaTable["7"], out cardItems);
if (cardItems != null)
{
int counter = 0;
foreach (var cardItem in cardItems)
{
if (counter < starNum - 1)
{
cards.Add(cardItem);
counter++;
}
itemPool.Add(cardItem);
}
}
BattlePassCardListUILogicManager.Instance.SetFlipCount(cards.Count);
}
}
示例6: OnNotifyToClientResultSuccessResp
public void OnNotifyToClientResultSuccessResp(LuaTable luaTable)
{
LoggerHelper.Debug("Handle Packet");
if (theOwner.sceneId == 10100)
{
#region 进度记录
GameProcManager.BattleWin(theOwner.CurMissionID, theOwner.CurMissionLevel);
#endregion
theOwner.IsNewPlayer = false;
ForceExitMissionReq();
return;
}
MogoUIManager.Instance.ShowMogoCommuntiyUI(CommunityUIParent.MainUI, false);
#region 进度记录
GameProcManager.BattleWin(theOwner.CurMissionID, theOwner.CurMissionLevel);
#endregion
#region 音效
EventDispatcher.TriggerEvent(SettingEvent.ChangeMusic, 60, SoundManager.PlayMusicMode.Single);
#endregion
if (luaTable != null && luaTable.Count > 0)
{
cards.Clear();
itemPool.Clear();
int time = Convert.ToInt32(luaTable["1"]);
// 能收到说明已经通关
int starNum = Convert.ToInt32(luaTable["2"]);
int scorePoint = Convert.ToInt32(luaTable["3"]);
int minutes = time / 60;
int second = time % 60;
if (luaTable.ContainsKey("4"))
{
List<Dictionary<int, int>> cardItems;
Utils.ParseLuaTable<List<Dictionary<int, int>>>((LuaTable)luaTable["4"], out cardItems);
if (cardItems != null)
{
int counter = 0;
foreach (var cardItem in cardItems)
{
if (counter < starNum - 1)
{
cards.Add(cardItem);
counter++;
}
itemPool.Add(cardItem);
}
}
BattlePassCardListUILogicManager.Instance.SetFlipCount(cards.Count);
}
//MogoUIManager.Instance.LoadMogoInstanceUI(() =>
//{
// InstanceUIViewManager.Instance.ShowInstancePassUI(true);
// InstanceUIViewManager.Instance.SetPassTime(minutes, second);
// InstanceUIViewManager.Instance.SetPassMark(starNum > 3 ? 3 : starNum);
//}, false);
LoggerHelper.Debug("Handle End");
MogoUIManager.Instance.LoadMogoInstanceUI(() =>
{
// Debug.LogError("LoadMogoInstanceUI");
//InstanceUIViewManager.Instance.ShowInstancePassUI(true);
InstancePassRewardUIViewManager.Instance.ShowInstancePassRewardUI(true);
InstanceUILogicManager.Instance.SetNewPassMessage(minutes, second, MogoWorld.thePlayer.GetMaxCombo(), scorePoint, starNum > 4 ? 4 : starNum);
theOwner.ResetMaxCombo();
}, false);
}
else
{
ClientMissionWon();
}
}
示例7: HandleResp
protected void HandleResp(CampaignReq handleCode, LuaTable luaTable, ushort auxiliaryArgument = 0)
{
switch (handleCode)
{
case CampaignReq.CAMPAIGN_NOTIFY_CLIENT_TO_START:
int startID = ConvertToInt32(luaTable["1"]);
CampaignActivityStart(startID);
break;
case CampaignReq.CAMPAIGN_NOTIFY_CLIENT_TO_FINISH:
int finishID = ConvertToInt32(luaTable["1"]);
CampaignActivityFinish(finishID);
break;
case CampaignReq.CAMPAIGN_JOIN:
int matchCountDownTime = ConvertToInt32(luaTable["1"]);
JoinSuccess(matchCountDownTime);
break;
case CampaignReq.CAMPAIGN_MATCH:
MatchSuccess();
break;
case CampaignReq.CAMPAIGN_LEAVE:
TimerHeap.DelTimer(countDownTimer);
if (delayShowOgreMustDieTip)
{
CheckDelayShowOgreMustDieTip(theOwner.sceneId, false);
}
else
{
MFUIManager.GetSingleton().SwitchUIWithLoad(MFUIManager.MFUIID.CityMainUI);
NormalMainUIViewManager.Instance.SetUIDirty();
}
break;
case CampaignReq.CAMPAIGN_COUNT_DOWN:
TimerHeap.DelTimer(countDownTimer);
BattleStartCountDown();
break;
case CampaignReq.CAMPAIGN_MISSION_COUNT_DOWN:
int passTime = ConvertToInt32(luaTable["1"]);
TowerDefenceStartCountDown(passTime);
break;
case CampaignReq.CAMPAIGN_RESULT:
TimerHeap.DelTimer(countDownTimer);
HandleReward(luaTable, auxiliaryArgument);
break;
case CampaignReq.CAMPAIGN_GET_LEFT_TIMES:
int leftTimes =0;
if (luaTable.ContainsKey("1"))
{
leftTimes= ConvertToInt32(luaTable["1"]);
SetOgreMustDieLeftTimes(leftTimes);
}
break;
case CampaignReq.CAMPAIGN_GET_ACTIVITY_LEFT_TIME:
int lastTime = ConvertToInt32(luaTable["1"]);
OgreMustDieOpen = true;
ogreMustDieLastTime = lastTime;
SetOgreMustDieFinishTimeEscape();
SetChallengeUIOgreMustDieData();
break;
case CampaignReq.CAMPAIGN_NOTIFY_WAVE_COUNT:
TimerHeap.DelTimer(countDownTimer);
MainUIViewManager.Instance.SetSelfAttackText(string.Empty, true);
TimerHeap.DelTimer(messageTimer);
int waveCount = ConvertToInt32(luaTable["1"]);
ShowMonsterWave(waveCount);
break;
}
}
示例8: HandleReward
public void HandleReward(LuaTable luaTable, ushort auxiliaryArgument)
{
// Debug.LogError("luatable" + luaTable + " \nauxiliaryArgument: " + auxiliaryArgument);
wave = ConvertToInt32(luaTable["1"]);
output = ConvertToInt32(luaTable["2"]);
exp = ConvertToInt32(luaTable["3"]);
gold = ConvertToInt32(luaTable["4"]);
rewardItems = new Dictionary<int,int>();
if (luaTable.ContainsKey("5"))
Mogo.Util.Utils.ParseLuaTable<Dictionary<int, int>>((LuaTable)luaTable["5"], out rewardItems);
Dictionary<int, int> result = new Dictionary<int,int>();
foreach (var item in rewardItems)
result.Add(item.Key, item.Value);
if (theOwner.sceneId == MogoWorld.globalSetting.homeScene)
{
if ((CampaignResult)auxiliaryArgument == CampaignResult.campaigning)
{
ControlStick.instance.Reset();
MFUIManager.GetSingleton().SwitchUIWithLoad(MFUIManager.MFUIID.BattlePassUINoCard);
BattlePassUINoCardUILogicManager.Instance.SetIsMVP(false);
BattlePassUINoCardUILogicManager.Instance.SetTitile(string.Empty);
BattlePassUINoCardUILogicManager.Instance.SetDefenceNum(wave.ToString());
BattlePassUINoCardUILogicManager.Instance.SetOutPut(output.ToString());
BattlePassUINoCardUILogicManager.Instance.SetMVPOutput(string.Empty);
BattlePassUINoCardUILogicManager.Instance.SetMVPName(string.Empty);
BattlePassUINoCardUILogicManager.Instance.SetRewardItemList(result);
BattlePassUINoCardUILogicManager.Instance.PlayAnim(false);
BattlePassUINoCardUILogicManager.Instance.SetUIDirty();
}
else
{
Debug.LogError("Are you kidding me? : " + auxiliaryArgument);
}
}
else
{
MogoUIManager.Instance.ShowMogoBattleMainUI();
int mvpOutput = ConvertToInt32(luaTable["6"]);
string mvpName = Convert.ToString(luaTable["7"]);
//Dictionary<int, int> mvpRewardItems = new Dictionary<int, int>();
//if (luaTable.ContainsKey("8"))
// Mogo.Util.Utils.ParseLuaTable<Dictionary<int, int>>((LuaTable)luaTable["8"], out mvpRewardItems);
//foreach (var item in mvpRewardItems)
//{
// if (result.ContainsKey(item.Key))
// result[item.Key] += item.Value;
// else
// result.Add(item.Key, item.Value);
//}
if ((CampaignResult)auxiliaryArgument == CampaignResult.win)
{
ControlStick.instance.Reset();
MFUIManager.GetSingleton().SwitchUIWithLoad(MFUIManager.MFUIID.BattlePassUINoCard);
BattlePassUINoCardUILogicManager.Instance.SetIsMVP(true);
BattlePassUINoCardUILogicManager.Instance.SetTitile(LanguageData.GetContent(28107));
BattlePassUINoCardUILogicManager.Instance.SetDefenceNum(wave.ToString());
BattlePassUINoCardUILogicManager.Instance.SetOutPut(output.ToString());
BattlePassUINoCardUILogicManager.Instance.SetMVPOutput(mvpOutput.ToString());
BattlePassUINoCardUILogicManager.Instance.SetMVPName(mvpName);
BattlePassUINoCardUILogicManager.Instance.SetRewardItemList(result);
BattlePassUINoCardUILogicManager.Instance.PlayAnim(true);
BattlePassUINoCardUILogicManager.Instance.SetUIDirty();
}
else if ((CampaignResult)auxiliaryArgument == CampaignResult.lose)
{
ControlStick.instance.Reset();
MFUIManager.GetSingleton().SwitchUIWithLoad(MFUIManager.MFUIID.BattlePassUINoCard);
BattlePassUINoCardUILogicManager.Instance.SetIsMVP(true);
BattlePassUINoCardUILogicManager.Instance.SetTitile(LanguageData.GetContent(28108));
BattlePassUINoCardUILogicManager.Instance.SetDefenceNum(wave.ToString());
BattlePassUINoCardUILogicManager.Instance.SetOutPut(output.ToString());
BattlePassUINoCardUILogicManager.Instance.SetMVPOutput(mvpOutput.ToString());
BattlePassUINoCardUILogicManager.Instance.SetMVPName(mvpName);
BattlePassUINoCardUILogicManager.Instance.SetRewardItemList(result);
BattlePassUINoCardUILogicManager.Instance.PlayAnim(true);
BattlePassUINoCardUILogicManager.Instance.SetUIDirty();
}
else if ((CampaignResult)auxiliaryArgument == CampaignResult.campaigning)
{
showRewardInCity = true;
}
}
}
示例9: FillEquipFXGridList
public void FillEquipFXGridList(LuaTable FXData = null)
{
if (FXData == null)
return;
System.Collections.Generic.List<EquipFXUIGridData> listData = new System.Collections.Generic.List<EquipFXUIGridData>();
var data = EquipSpecialEffectData.dataMap.OrderBy(x => x.Key);
foreach (var item in data)
{
if (item.Value.group == 2)
{
int currentMark = CalculateEquipMarks(item.Value.level);
int totalMark = item.Value.activeScore;
EquipFXUIGridData gridData = new EquipFXUIGridData();
gridData.gridIcon = "";// = ItemParentData.GetItem(item.Value.icon).Icon;
if (FXData.ContainsKey(item.Key.ToString()))
{
gridData.isActive = true;
}
else
{
gridData.isActive = false;
}
gridData.gridProgressText = string.Concat(currentMark, " / ", totalMark);
gridData.gridProgressSize = (float)currentMark / (float)totalMark;
gridData.gridText = LanguageData.GetContent(item.Value.activeDesp);
listData.Add(gridData);
}
}
RefreshFXGrid(listData);
}