Browse Source

Merge pull request #622 from eesast/dev

perf:  make viewRange and so on readonly
tags/v0.1.0
shangfengh GitHub 2 years ago
parent
commit
1846212340
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 40 deletions
  1. +1
    -1
      docs/CAPI接口(cpp).md
  2. +1
    -1
      docs/CAPI接口(python).md
  3. +5
    -1
      docs/版本更新说明.md
  4. +1
    -1
      logic/GameClass/GameObj/Character/Character.Skill.cs
  5. +6
    -36
      logic/GameClass/GameObj/Character/Character.cs

+ 1
- 1
docs/CAPI接口(cpp).md View File

@@ -6,6 +6,7 @@
### 主动指令
- 每帧最多发送50条主动指令
- EndAllAction 及 Move 指令调用数总和一帧内不超过 10 次
- 指令执行失败可能会使你返回idle状态,而非简单的无效

#### 移动
- `std::future<bool> Move(int64_t timeInMilliseconds, double angleInRadian)`:移动,`timeInMilliseconds` 为移动时间,单位毫秒;`angleInRadian` 表示移动方向,单位弧度,使用极坐标,**竖直向下方向为 x 轴,水平向右方向为 y 轴**。因为移动过程中你会受到多种干扰使得移动结果不符合你的预期;因此建议小步移动,边移动边考虑之后的行为。
@@ -18,7 +19,6 @@
#### 人物
- `std::future<bool> EndAllAction()`:可以使不处在不可行动状态中的玩家终止当前行动
- 在指令仍在进行时,重复发出同一类型的交互指令和移动指令是无效的,你需要先发出 EndAllAction 指令终止进行的指令
- 实际上唤醒或勉励不同的人是有效的

#### 攻击
- `std::future<bool> Attack(double angleInRadian)`:`angleInRadian` 为攻击方向


+ 1
- 1
docs/CAPI接口(python).md View File

@@ -7,6 +7,7 @@
### 主动指令
- 每帧最多发送 50 条主动指令
- EndAllAction 及 Move 指令调用数总和一帧内不超过 10 次
- 指令执行失败可能会使你返回idle状态,而非简单的无效

#### 移动

@@ -22,7 +23,6 @@

- `def EndAllAction(self) -> Future[bool]`:可以使不处在不可行动状态中的玩家终止当前行动
- 在指令仍在进行时,重复发出同一类型的交互指令和移动指令是无效的,你需要先发出 EndAllAction 指令终止进行的指令
- 实际上唤醒或勉励不同的人是有效的
- EndAllAction 及 Move 指令调用数总和一帧内不超过 10 次

#### 攻击


+ 5
- 1
docs/版本更新说明.md View File

@@ -91,5 +91,9 @@
# 5月26日12:00更新
- fix:修复了救人中断后不继续沉迷的问题

# 5月26日14:00更新
- improve:优化CD逻辑

# 5月26日更新
- improve:优化CD逻辑
- docs:指令执行失败可能会使你返回idle状态,而非简单的无效
- docs:删除了“实际上唤醒或勉励不同的人是有效的”

+ 1
- 1
logic/GameClass/GameObj/Character/Character.Skill.cs View File

@@ -40,7 +40,7 @@ namespace GameClass.GameObj
this.BulletOfPlayer = this.OriBulletOfPlayer = Occupation.InitBullet;
this.concealment = Occupation.Concealment;
this.alertnessRadius = Occupation.AlertnessRadius;
this.ViewRange = Occupation.ViewRange;
this.viewRange = Occupation.ViewRange;
this.characterType = characterType;
this.SpeedOfOpeningOrLocking = Occupation.SpeedOfOpeningOrLocking;
this.SpeedOfClimbingThroughWindows = Occupation.SpeedOfClimbingThroughWindows;


+ 6
- 36
logic/GameClass/GameObj/Character/Character.cs View File

@@ -157,44 +157,14 @@ namespace GameClass.GameObj
bgmDictionary[bgm] = value;
}

private int alertnessRadius;
public int AlertnessRadius
{
get => alertnessRadius;
set
{
lock (gameObjLock)
{
alertnessRadius = value;
}
}
}
private readonly int alertnessRadius;
public int AlertnessRadius => alertnessRadius;

private double concealment;
public double Concealment
{
get => concealment;
set
{
lock (gameObjLock)
{
concealment = value;
}
}
}
private readonly double concealment;
public double Concealment => concealment;

private int viewRange;
public int ViewRange
{
get => viewRange;
set
{
lock (gameObjLock)
{
viewRange = (value > 0) ? value : 0;
}
}
}
private readonly int viewRange;
public int ViewRange => viewRange;
#endregion
#region 交互相关的基本属性及方法
private int speedOfOpeningOrLocking;


Loading…
Cancel
Save