You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
|
|
using MongoDB.Bson.Serialization.Options;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
{
|
|
|
|
[ChildType(typeof(Battle))]
|
|
|
|
#if SERVER
|
|
|
|
public sealed class Unit: Entity, IAwake, IAddComponent, IGetComponent,IUpdate
|
|
|
|
#else
|
|
|
|
public class Unit: Entity, IAwake
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
#region 食物
|
|
|
|
private long m_food;
|
|
|
|
public long Food
|
|
|
|
{
|
|
|
|
get { return m_food; }
|
|
|
|
set
|
|
|
|
{
|
|
|
|
m_food = value;
|
|
|
|
#if !SERVER
|
|
|
|
Game.EventSystem.Publish(new EventType.UpdateFood() { Unit = this, Food = m_food }) ;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 水源
|
|
|
|
private long m_water;
|
|
|
|
public long Water
|
|
|
|
{
|
|
|
|
get { return m_water; }
|
|
|
|
set
|
|
|
|
{
|
|
|
|
m_water = value;
|
|
|
|
#if !SERVER
|
|
|
|
Game.EventSystem.Publish(new EventType.UpdateWater() { Unit = this, Water = m_water });
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
public int SilverTael;
|
|
|
|
public int GoldIngot;
|
|
|
|
public int Season;
|
|
|
|
public int GameTime;
|
|
|
|
public int Prosperity;
|
|
|
|
public int Scale;
|
|
|
|
public int Day;
|
|
|
|
public string Name;
|
|
|
|
public int EventSeed;
|
|
|
|
public List<string> EventNames;
|
|
|
|
|
|
|
|
|
|
|
|
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
|
|
|
|
public Dictionary<int, long> FighterDic=new Dictionary<int, long>();
|
|
|
|
|
|
|
|
[BsonIgnore]
|
|
|
|
public long UpdateTime;
|
|
|
|
|
|
|
|
[BsonIgnore]
|
|
|
|
public long UpdateValleyTime;
|
|
|
|
|
|
|
|
[BsonIgnore]
|
|
|
|
public SeasonConfig SeasonConfig;
|
|
|
|
[BsonIgnore]
|
|
|
|
public long BattleId;
|
|
|
|
|
|
|
|
[BsonIgnore]
|
|
|
|
public Dictionary<long, Farmland> FarmlandDic = new Dictionary<long, Farmland>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|