add new classes

This commit is contained in:
yyc12345 2022-08-29 21:54:58 +08:00
parent fdcdbdc30a
commit 6deaa4c022
11 changed files with 206 additions and 45 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BallanceStalker.Cores.Bmmo {
public class BmmoContext {
}
}

View File

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BallanceStalker.Cores.Managers {
public class MultiplayManager {
}
}

View File

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BallanceStalker.Cores.Managers {
public class RecManager {
}
}

View File

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BallanceStalker.Cores.Rec {
public class BmmoSwungRec {
}
}

View File

@ -0,0 +1,55 @@
using BallanceStalker.Cores.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace BallanceStalker.Cores.Rec {
public class SpiritTrailRec : Utils.IRec {
public SpiritTrailRec(string rec_folder) {
mIsReady = mIsPlaying = false;
Task.Run(() => {
// load data
lock (mStatusLock) {
mIsReady = true;
}
});
}
public event Action<long, string> RecRegisterBall;
public event Action RecPlaying;
public event Action RecPaused;
public event Action<long> RecUnregisterBall;
object mStatusLock;
bool mIsReady, mIsPlaying;
public void Pause() {
lock (mStatusLock) {
mIsPlaying = false;
}
}
public void Play() {
lock (mStatusLock) {
mIsPlaying = true;
}
}
public void Seek(float sec) {
;
}
public void Tick(float delta_sec, List<RecBallStateReport> report) {
lock (mStatusLock) {
if (!mIsPlaying || !mIsReady) return;
}
}
}
}

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BallanceStalker.Cores.Utils {
public enum BallType : UInt32 {
Stone,
Wood,
Paper
}
public struct VxVector {
float X, Y, Z;
}
public struct VxQuaternion {
float X, Y, Z, W;
}
public struct VxBallState {
VxVector Pos;
VxQuaternion Quat;
}
public struct RecBallStateReport {
long Identifier;
VxBallState BallState;
}
}

View File

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BallanceStalker.Cores.Utils {
public interface IMultiplay {
}
}

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BallanceStalker.Cores.Utils {
public interface IRec {
void Play();
void Pause();
void Seek(float sec);
void Tick(float delta_sec, List<RecBallStateReport> report);
/// <summary>
/// register a ball
/// long is identifier, string is name
/// </summary>
event Action<long, string> RecRegisterBall;
event Action RecPlaying;
event Action RecPaused;
/// <summary>
/// unregister a ball
/// long is identifier
/// </summary>
event Action<long> RecUnregisterBall;
}
}

View File

@ -17,7 +17,6 @@ namespace BallanceStalker.Scenes {
BallanceStalker.Cores.BStalkerContext.BSShutdown(); BallanceStalker.Cores.BStalkerContext.BSShutdown();
} }
public override void _Ready() { public override void _Ready() {
mMenuManager = GetNode<Gui.MenuManager>("MenuManager"); mMenuManager = GetNode<Gui.MenuManager>("MenuManager");
mConsolePanel = GetNode<Gui.ConsolePanel>("ConsolePanel"); mConsolePanel = GetNode<Gui.ConsolePanel>("ConsolePanel");

View File

@ -8,9 +8,8 @@ namespace BallanceStalker.Scenes.Entities {
private Dictionary<Guid, ShadowBall> mBallDict = new Dictionary<Guid, ShadowBall>(); private Dictionary<Guid, ShadowBall> mBallDict = new Dictionary<Guid, ShadowBall>();
private PackedScene mTemplateShadowBall; private PackedScene mTemplateShadowBall;
// Called when the node enters the scene tree for the first time.
public override void _Ready() { public override void _Ready() {
mTemplateShadowBall = ResourceLoader.Load<PackedScene>("res://scenes/stages/ShadowBall.tscn"); mTemplateShadowBall = ResourceLoader.Load<PackedScene>("res://scenes/entities/ShadowBall.tscn");
} }