|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
|
|
using ProtoBuf;
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
{
|
|
|
|
[ProtoContract]
|
|
|
|
[Config]
|
|
|
|
public partial class MissionChildConfigCategory : ProtoObject, IMerge
|
|
|
|
{
|
|
|
|
public static MissionChildConfigCategory Instance;
|
|
|
|
|
|
|
|
[ProtoIgnore]
|
|
|
|
[BsonIgnore]
|
|
|
|
private Dictionary<int, MissionChildConfig> dict = new Dictionary<int, MissionChildConfig>();
|
|
|
|
|
|
|
|
[BsonElement]
|
|
|
|
[ProtoMember(1)]
|
|
|
|
private List<MissionChildConfig> list = new List<MissionChildConfig>();
|
|
|
|
|
|
|
|
public MissionChildConfigCategory()
|
|
|
|
{
|
|
|
|
Instance = this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Merge(object o)
|
|
|
|
{
|
|
|
|
MissionChildConfigCategory s = o as MissionChildConfigCategory;
|
|
|
|
this.list.AddRange(s.list);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void EndInit()
|
|
|
|
{
|
|
|
|
foreach (MissionChildConfig config in list)
|
|
|
|
{
|
|
|
|
config.EndInit();
|
|
|
|
this.dict.Add(config.Id, config);
|
|
|
|
}
|
|
|
|
this.AfterEndInit();
|
|
|
|
}
|
|
|
|
|
|
|
|
public MissionChildConfig Get(int id)
|
|
|
|
{
|
|
|
|
this.dict.TryGetValue(id, out MissionChildConfig item);
|
|
|
|
|
|
|
|
if (item == null)
|
|
|
|
{
|
|
|
|
throw new Exception($"配置找不到,配置表名: {nameof (MissionChildConfig)},配置id: {id}");
|
|
|
|
}
|
|
|
|
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool Contain(int id)
|
|
|
|
{
|
|
|
|
return this.dict.ContainsKey(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Dictionary<int, MissionChildConfig> GetAll()
|
|
|
|
{
|
|
|
|
return this.dict;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<MissionChildConfig> GetList()
|
|
|
|
{
|
|
|
|
return this.list;
|
|
|
|
}
|
|
|
|
|
|
|
|
public MissionChildConfig GetOne()
|
|
|
|
{
|
|
|
|
if (this.dict == null || this.dict.Count <= 0)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return this.dict.Values.GetEnumerator().Current;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[ProtoContract]
|
|
|
|
public partial class MissionChildConfig: ProtoObject, IConfig
|
|
|
|
{
|
|
|
|
/// <summary>编号</summary>
|
|
|
|
[ProtoMember(1)]
|
|
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>任务名称</summary>
|
|
|
|
[ProtoMember(2)]
|
|
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>前置任务</summary>
|
|
|
|
[ProtoMember(3)]
|
|
|
|
public int PreMission { get; set; }
|
|
|
|
/// <summary>触发类型</summary>
|
|
|
|
[ProtoMember(4)]
|
|
|
|
public int[] TriggerType { get; set; }
|
|
|
|
/// <summary>触发参数1</summary>
|
|
|
|
[ProtoMember(5)]
|
|
|
|
public int TriggerConditionParameter1 { get; set; }
|
|
|
|
/// <summary>等级条件</summary>
|
|
|
|
[ProtoMember(6)]
|
|
|
|
public int Lv { get; set; }
|
|
|
|
/// <summary>战力条件</summary>
|
|
|
|
[ProtoMember(7)]
|
|
|
|
public int CombatCapability { get; set; }
|
|
|
|
/// <summary>其他条件</summary>
|
|
|
|
[ProtoMember(8)]
|
|
|
|
public int[] Preconditions { get; set; }
|
|
|
|
/// <summary>条件参数</summary>
|
|
|
|
[ProtoMember(9)]
|
|
|
|
public int[] PreconditionsParameter { get; set; }
|
|
|
|
/// <summary>任务步骤</summary>
|
|
|
|
[ProtoMember(10)]
|
|
|
|
public int[] MissonStep { get; set; }
|
|
|
|
/// <summary>经验奖励</summary>
|
|
|
|
[ProtoMember(11)]
|
|
|
|
public int Exp { get; set; }
|
|
|
|
/// <summary>修为奖励</summary>
|
|
|
|
[ProtoMember(12)]
|
|
|
|
public int Sophisticate { get; set; }
|
|
|
|
/// <summary>银两奖励</summary>
|
|
|
|
[ProtoMember(13)]
|
|
|
|
public int SilverTael { get; set; }
|
|
|
|
/// <summary>元宝奖励</summary>
|
|
|
|
[ProtoMember(14)]
|
|
|
|
public int GoldIngot { get; set; }
|
|
|
|
/// <summary>物品奖励</summary>
|
|
|
|
[ProtoMember(15)]
|
|
|
|
public int[] ItemReward { get; set; }
|
|
|
|
/// <summary>物品数量</summary>
|
|
|
|
[ProtoMember(16)]
|
|
|
|
public int[] ItemAmount { get; set; }
|
|
|
|
/// <summary>任务简述</summary>
|
|
|
|
[ProtoMember(17)]
|
|
|
|
public string MissionShortDescription { get; set; }
|
|
|
|
/// <summary>任务描述</summary>
|
|
|
|
[ProtoMember(18)]
|
|
|
|
public string MissionDescription { get; set; }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|