-
Notifications
You must be signed in to change notification settings - Fork 5
LoopGearNetworkTestが通るように修正 #340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
public const float DefaultBeltConveyorHeight = 0.3f; | ||
private readonly BlockConnectorComponent<IBlockInventory> _blockConnectorComponent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
オートフォーマッタでprivateとpublicの順番ゴチャゴチャになってる?
public → private readonly → private の順番にしたい
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このprで修正します?
riderのオートフォーマッタがやったので今後弄ったときのためにも修正するならeditorconfigごと修正しないといけないと思ってます
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このPRでの修正は不要です(私が過去やってしまったやつものこっているので
@@ -135,6 +107,41 @@ public void SetItem(int slot, IItemStack itemStack) | |||
_inventoryItems[slot] = new BeltConveyorInventoryItem(itemStack.Id, TimeOfItemEnterToExit, itemStack.ItemInstanceId); | |||
} | |||
|
|||
public void Destroy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここの順番入れ替えもオートフォーマッタ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
です
@@ -22,7 +23,7 @@ public ConnectingInventoryListPriorityInsertItemService(BlockConnectorComponent< | |||
|
|||
public IItemStack InsertItem(IItemStack itemStack) | |||
{ | |||
IReadOnlyList<IBlockInventory> inventories = _blockConnectorComponent.ConnectTargets; | |||
IReadOnlyList<IBlockInventory> inventories = _blockConnectorComponent.ConnectTargets.Keys.ToArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to de 8000 scribe this comment to others. Learn more.
色んなところでやっちゃってますけど、ToArrayとかはどこかで一掃したいですよね〜〜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
僕は必要であれば気にしないタイプですが、確かに見る側からしたら鬱陶しいですよねー
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コード的な理由というよりは、GCが増えるので気になりポイントですね
そのうちパフォーマンスが重要になりそうなので、どこかのタイミングで一掃したいなぁ見たいな感じです
{ | ||
public static readonly GearConnectOptionLoader Loader = new(); | ||
|
||
public IConnectOption Load(dynamic connectorOption) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GearConnectOptionLoader と GearConnectOption を同じファイルに書いておきたい感ありますが、アセンブリ的に厳しいやつですかね
IConnectOptionLoaderをBlock.Interfaceに置けば解決する説
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
かもしれないです
やってみます
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DONE
|
||
var option = connector.option; | ||
if (option != null && loader != null) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
option != nullはいらないです
option == null なのにローダー指定してるのはどっちかが間違っているので、明確に誤りな部分はちゃんとエラーをすろーするようにしておきたいですね
//TODO エラーログ出力する みたいなの付けておいてください
Sorry, something went wrong.
All reactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しましたー
Sorry, something went wrong.
All reactions
var gearConnectSettings = BlockConfigJsonLoad.GetConnectSettings(blockParam, "gearConnects"); | ||
|
||
|
||
var gearConnectSettings = BlockConfigJsonLoad.GetConnectSettings(blockParam, "gearConnects", GearConnectOptionLoader.Loader); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gearConnects、どこかにpublic const stringとして置いておきたいです
Sorry, something went wrong.
All reactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"gearConnects"はもとからあったもので追加したわけじゃないので、Issue作って別PRでやりませんか?
Sorry, something went wrong.
All reactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OKです
Sorry, something went wrong.
All reactions
var gearPositionC = new Vector3Int(0, 0, 1); | ||
var gearPositionD = new Vector3Int(1, 0, 1); | ||
var gearPositionC = new Vector3Int(0, 1, 0); | ||
var gearPositionD = new Vector3Int(1, 1, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
All reactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しましたー
Sorry, something went wrong.
All reactions
|
||
// smallGearDの回転方向とRPMのテスト | ||
Assert.AreEqual(rpm, smallGearD.CurrentRpm); | ||
Assert.AreEqual(false, smallGearD.IsCurrentClockwise); | ||
Assert.AreEqual(true, smallGearD.IsCurrentClockwise); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これも戻す必要ありそう
Sorry, something went wrong.
All reactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しましたー
Sorry, something went wrong.
All reactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
Sorry, something went wrong.
All reactions
"gearConnects"という文字列を直置きしている問題を修正
sakastudio
Successfully merging this pull request may close these issues.
No description provided.