mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
63 lines
1.7 KiB
C#
63 lines
1.7 KiB
C#
|
using AppGame.Systems;
|
|||
|
using Plugins.JNGame.System;
|
|||
|
using Plugins.JNGame.Util;
|
|||
|
using Service;
|
|||
|
|
|||
|
namespace AppGame
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// App 环境
|
|||
|
/// </summary>
|
|||
|
public enum AppEnv
|
|||
|
{
|
|||
|
Client,
|
|||
|
Server,
|
|||
|
ServerClient,
|
|||
|
}
|
|||
|
public class App
|
|||
|
{
|
|||
|
|
|||
|
public static AppEnv Env = AppEnv.ServerClient;
|
|||
|
/// <summary>
|
|||
|
/// 业务服务器
|
|||
|
/// </summary>
|
|||
|
public static readonly JNGSocket Business = new JNGSocket();
|
|||
|
/// <summary>
|
|||
|
/// Tile服务器
|
|||
|
/// </summary>
|
|||
|
public static readonly JNGServer Server = new JNGServer();
|
|||
|
/// <summary>
|
|||
|
/// Tile客户端
|
|||
|
/// </summary>
|
|||
|
public static readonly JNGClientGroup Client = new JNGClientGroup();
|
|||
|
public static readonly JNGResService Resource = new JNGResService();
|
|||
|
public static readonly JNGGame Game = new JNGGame();
|
|||
|
public static readonly JNGSocket Socket = new JNGSocket();
|
|||
|
public static readonly JAPI API = new(new JAPIConfig(){BaseURL = "http://127.0.0.1:8080"});
|
|||
|
public static readonly GAPI GAPI = new GAPI();
|
|||
|
public static int ClientID => Client.ClientID;
|
|||
|
|
|||
|
public static SystemBase[] AllSystem()
|
|||
|
{
|
|||
|
return new SystemBase[]
|
|||
|
{
|
|||
|
Business,
|
|||
|
Client,
|
|||
|
IsServer() ? Server : null,
|
|||
|
Resource,
|
|||
|
Game,
|
|||
|
// Socket,
|
|||
|
};
|
|||
|
}
|
|||
|
|
|||
|
public static bool IsClient()
|
|||
|
{
|
|||
|
return Env is AppEnv.Client or AppEnv.ServerClient;
|
|||
|
}
|
|||
|
public static bool IsServer()
|
|||
|
{
|
|||
|
return Env is AppEnv.Server or AppEnv.ServerClient;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|