/*
 * 由SharpDevelop创建。
 * 用户： Administrator
 * 日期: 2019-01-22
 * 时间: 16:00
 * 
 * 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
 */
using System;
using System.Collections.Generic;

namespace GameData
{
    /// <summary>
    /// 战斗数据
    /// </summary>
    public class FightData
    {

        /// <summary>
        /// 
        /// </summary>
        public FightData() { }

        /// <summary>
        /// 所有的战斗包 触发hand逻辑变化
        /// </summary>
        public List<fightdataone> fightPack = new List<fightdataone>();
    }

    /// <summary>
    /// 一次战斗数据
    /// </summary>
    public class fightdataone
    {
        /// <summary>
        /// 类型
        /// </summary>
        public int lx;
        /// <summary>
        /// 数据
        /// </summary>
        public string data;
    }

    /// <summary>
    /// 房间战绩数据
    /// </summary>
    public class RoomFightData
    {
        /// <summary>
        /// 玩家分数
        /// </summary>
        public long[] playScore;

        /// <summary>
        /// 玩家的座位
        /// </summary>
        public int[] seat;

        /// <summary>
        /// 战斗数据
        /// </summary>
        public FightData data;

        /// <summary>
        /// 结束类型
        /// </summary>
        public int style;

        public RoomFightData() { }
    }

    public static class GetOssPath
    {
        /// <summary>
        /// 桶名
        /// </summary>
        public const string BucketName8880666s = "8880666s";

        /// <summary>
        /// oss桶里面保存的文件夹
        /// </summary>
        public const string FilePaht = "RoomFight";
        /// <summary>
        /// 根据文件返回OSS的完整路径
        /// </summary>
        /// <param name="fileName">文件名</param>
        /// <param name="serId">游戏服务器Id</param>
        /// <param name="data">要获取哪一天的数据</param>
        /// <returns></returns>
        public static string GetKey(string fileName, int serId,DateTime data)
        {
            return $"{FilePaht}/{data.ToString("yyyyMMdd")}/{serId}/{fileName}";
        }

        /// <summary>
        /// 获取战斗数据的文件名
        /// </summary>
        /// <param name="weiyima">唯一码</param>
        /// <param name="idx">第几局</param>
        /// <returns></returns>
        public static string GetFileName(string weiyima, int idx)
        {
            return $"{weiyima}_{idx}.txt";
        }

        /// <summary>
        /// 客户端获取回放战绩OSS Http地址
        /// </summary>
        /// <param name="weiyima">战绩唯一码</param>
        /// <param name="idx">第几局</param>
        /// <param name="gameServerId">服务器Id</param>
        /// <param name="data">要获取哪一天的数据</param>
        /// <returns></returns>
        public static string GetFileHttpUrl(string weiyima, int idx, int gameServerId, DateTime data)
        {
            return $"https://{BucketName8880666s}.oss-cn-hangzhou.aliyuncs.com/{GetKey(GetFileName(weiyima, idx), gameServerId, data)}";
        }
    }
}
