规范命名空间
具体来说就是 SepCore 开头,然后接所属的模块名,比如 SepCore.Entity,SepCore.Simulation,SepCore.Procedure
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using SepCore.Definition;
|
||||
using Entity.Weapon;
|
||||
using SepCore.Entity.Weapon;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
|
||||
@@ -3,11 +3,9 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SepCore.DataTable;
|
||||
using SepCore.Definition;
|
||||
using Entity;
|
||||
using Entity.EntityData;
|
||||
using CustomUtility;
|
||||
using SepCore.Entity;
|
||||
using SepCore.CustomUtility;
|
||||
using GameFramework.DataTable;
|
||||
using SepCore.Utility;
|
||||
using UnityEngine;
|
||||
using UnityGameFramework.Runtime;
|
||||
using Random = UnityEngine.Random;
|
||||
@@ -283,7 +281,7 @@ namespace SepCore.UI
|
||||
|
||||
if (goods.GoodsType == GoodsType.Prop)
|
||||
{
|
||||
DRProp drProp = _propDataTable != null ? _propDataTable.GetDataRow(goods.GoodsTypeId) : null;
|
||||
DRProp drProp = _propDataTable.GetDataRow(goods.GoodsTypeId);
|
||||
if (drProp == null)
|
||||
{
|
||||
Log.Warning($"ShopFormUseCase::TryGetGoodsRarity: Missing DRProp, id = {goods.GoodsTypeId}");
|
||||
@@ -355,8 +353,8 @@ namespace SepCore.UI
|
||||
|
||||
DRWeapon drWeapon = _weaponDataTable.GetDataRow(goods.GoodsTypeId);
|
||||
|
||||
var weaponData = EntityDataFactory.Create(GameEntry.Entity.GenerateSerialId(), drWeapon, Player.Id,
|
||||
CampType.Player);
|
||||
int id = GameEntry.Entity.NextId();
|
||||
var weaponData = EntityDataFactory.Create(id, drWeapon, Player.Id, CampType.Player);
|
||||
if (weaponData == null)
|
||||
{
|
||||
Log.Warning(
|
||||
@@ -379,40 +377,23 @@ namespace SepCore.UI
|
||||
|
||||
public bool TryRecycleWeapon(int argsIndex, int argsPrice)
|
||||
{
|
||||
Player player = Player;
|
||||
if (player == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var weapons = player.Weapons;
|
||||
if (weapons == null || weapons.Count <= 1)
|
||||
var weapons = Player.Weapons;
|
||||
if (weapons.Count <= 1)
|
||||
{
|
||||
Log.Warning("ShopFormUseCase::TryRecycleWeapon: Can not recycle the last weapon.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (argsIndex < 0 || argsIndex >= weapons.Count)
|
||||
{
|
||||
Log.Warning($"ShopFormUseCase::TryRecycleWeapon: Invalid weapon index = {argsIndex}");
|
||||
return false;
|
||||
}
|
||||
|
||||
var weapon = weapons[argsIndex];
|
||||
if (weapon == null)
|
||||
{
|
||||
Log.Warning("ShopFormUseCase::TryRecycleWeapon: Weapon is null.");
|
||||
return false;
|
||||
}
|
||||
|
||||
int recyclePrice = Mathf.Max(0, argsPrice);
|
||||
if (!player.RemoveWeapon(weapon))
|
||||
if (!Player.RemoveWeapon(weapon))
|
||||
{
|
||||
Log.Warning("ShopFormUseCase::TryRecycleWeapon: Remove weapon failed.");
|
||||
return false;
|
||||
}
|
||||
|
||||
player.Coin += recyclePrice;
|
||||
Player.Coin += recyclePrice;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user