Commit Graph

40 Commits

Author SHA1 Message Date
Pieter-Jan Briers
1646297039 Remove most static IoCManager. accesses from engine. (#3466)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-11-15 22:00:28 +11:00
Pieter-Jan Briers
490a4efff8 IoCManager.InitThread now returns new IDependencyCollection. 2022-11-12 12:24:31 +01:00
Pieter-Jan Briers
a416eedff0 Fix some bad doc comment links to IoCManager.Resolve{T}() 2022-11-12 12:23:12 +01:00
Pieter-Jan Briers
2fe0c94d84 Register<T> extension for IDependencyCollection. 2022-11-12 12:12:05 +01:00
Pieter-Jan Briers
2f22de4eff Make IoC Register have where TInterface : class 2022-11-12 12:11:19 +01:00
Vera Aguilera Puerto
d404494018 ViewVariables Exorcism Part 1: Of paths and commands (#3214) 2022-10-14 19:03:44 +02:00
Pieter-Jan Briers
8b8e499615 Avoid TLS lookup in IoCManager.Resolve<T>(ref T) if instance provided. 2022-05-23 23:33:01 +02:00
Pieter-Jan Briers
de4d255841 Analyzer to enforce classes to be either [Virtual], abstract, or sealed. (#2469)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-02-05 19:31:58 +01:00
Acruid
97f5131ce0 Fixed bug where _pendingResolves was not getting cleared. (#2328)
Added an option to defer field DI for RegisteredInstances until BuildGraph is called. This lets you register instances that contain dependency fields that are not instantiated yet.
2021-12-12 16:12:52 -08:00
Acruid
424e0768c8 Fixed some code that I forgot to change to help IoC instantiate protected constructors. 2021-11-17 03:10:12 -08:00
Acruid
e1b9327ec0 Misc Engine Tweaks (#2238) 2021-11-17 09:39:18 +01:00
Vera Aguilera Puerto
6cf5021efa Add Resolves to IoCManager and EntitySystemManager (#2231) 2021-11-14 19:41:34 +01:00
Pieter-Jan Briers
5ab6aba20b More implicit use attributes.
This means that entity systems and IoC managers should no longer need [UsedImplicitly] to suppress "object never instantiated" warnings.
2021-08-24 03:13:23 +02:00
Paul Ritter
8c1e075c91 EntitySystem DependencyCollection & EntitySystem dependencies (#1890)
* started work

* tests

* namespace

* working

* thonk

Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
Co-authored-by: Vera Aguilera Puerto <gradientvera@outlook.com>
2021-07-26 12:10:03 +02:00
Acruid
e5fd4f5700 DependencyCollection Children (#1833)
Adds a new register function for registering a simple Type without an interface.
2021-06-21 02:15:23 +02:00
Pieter-Jan Briers
1147d6fd9a Do not cache injector delegates for entity system creation. 2021-06-21 01:44:36 +02:00
Pieter-Jan Briers
a266e21d9e Add single-type IoC register call. 2021-05-24 22:05:15 +02:00
Acruid
f9074811f9 Adds constructor injection to the IoCManager & DependencyCollection. 2021-03-25 01:16:08 -07:00
Acruid
2183cd7ca1 Massive Namespace Cleanup (#1544)
* Removed the Interfaces folder.
* All objects inside the GameObjects subfolders are now in the GameObjects namespace.
* Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces.
* Simplified Robust.client.Graphics namespace.
* Automated remove redundant using statements.
2021-02-10 23:27:19 -08:00
Acruid
bded7ad228 You can now provide a factory delegate to IoC register calls. 2021-02-06 23:00:08 -08:00
Pieter-Jan Briers
a41f64f30e sandboxing (#1408) 2020-11-26 23:37:31 +01:00
DrSmugleaf
b8e5b47e7a Use 'new' expression in places where the type is evident for the engine (#1415)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-11-26 00:16:55 +01:00
Pieter-Jan Briers
362b7804d9 Fix issues with .NET 5. 2020-11-11 00:46:35 +01:00
Pieter-Jan Briers
5faa8a59c1 Add some [Pure] annotations. 2020-08-29 07:53:50 +02:00
Acruid
1513389fc1 Adds a property to IoCManager that gives access to the IDependencyCollection singleton of the thread. 2020-08-18 16:29:57 -07:00
Pieter-Jan Briers
8f590a7ba9 DependencyCollection.RegisterInstance no longer caches injectors.
Small optimization.
2020-07-09 02:55:04 +02:00
Pieter-Jan Briers
41f1dd3fa0 Hopefully fix parallel game states 2020-06-24 22:55:59 +02:00
Pieter-Jan Briers
67efd69679 Add explicit update dependency specification between entity systems.
This allows a system to say "I want to update after this other system does".

Based on @chairbender's work with the input binding stuff.
2020-06-19 00:18:59 +02:00
Pieter-Jan Briers
ec0f4b35f7 Enable nullable reference types on Robust.Shared and fix all warnings. (#1109) 2020-06-08 01:13:01 +02:00
PrPleGoo
bb0e6917b8 Decimal reagents requirements (#1018) 2020-03-28 13:48:57 +01:00
Pieter-Jan Briers
761b06d68a Add threading assertions to IoCManager. 2019-12-22 21:47:00 +01:00
Pieter-Jan Briers
31adf9e4fc Mention thread locality in IoCManager documentation. 2019-12-01 15:12:06 +01:00
Pieter-Jan Briers
73a34fc53a Use DynamicMethod for dependency injection. (#864)
* Use DynamicMethod for dependency injection.

Should be way faster to initialize types and also have no allocation overhead

* Cleanup, don't make injectors for types without dependencies

* Fix Framework, maybe?

* Test the new system explicitly.
2019-09-09 01:43:22 +02:00
Pieter-Jan Briers
85a4375905 Various performance optimizations. 2019-08-01 00:10:20 +02:00
Acruid
b26a370504 You can now call IoCManager.Clear() regardless of the container being instantiated for your thread. Previously you would get a null exception. Now the function does nothing (as expected) if the container does not exist. 2019-07-29 11:39:42 -07:00
Pieter-Jan Briers
414bd95eb2 DynamicTypeFactory improvements:
Can now make instances with constructor arguments.
Adds some helpers.
2019-07-23 21:08:01 +02:00
Pieter-Jan Briers
bb4a1eda8e Project file refactor (#819)
* Project file refactor

Move all the .csproj files to the new .NET Core style.
This doesn't make any difference for compiling for Framework,
but it does reduce a ton of useless boilerplate.

As an extension of this, killed a bunch of uncompiled & unmaintained .cs files.

Compiling for release (to profile) works now.
Removed AnyCPU targets from the solution file.

* Fix compiler warnings.
2019-05-28 00:16:01 +02:00
Pieter-Jan Briers
5077b5ec4e Do not hide exceptions thrown in IoC service Dispose. 2019-05-08 22:59:45 +02:00
Pieter-Jan Briers
e2c7a0086c Integration Testing Framework. (#804)
* Server works if not connected to a tty.

* Rich presence does not run IoC resolution at runtime anymore.

* Work towards integration tests.

Mostly work related to making it so the server and client can run in
parallel, and allowing more control over main loop for testing.

* Lots of code relating to integration tests.
2019-05-04 17:51:20 +02:00
Silver
25926a17b7 Renames SS14.* to Robust.* (#793)
RobustToolbox projects should be named Robust.* 

This PR changes the RobustToolbox projects from SS14.* to Robust.*

Updates SS14.* prefixes/namespaces to Robust.*
Updates SpaceStation14.sln to RobustToolbox.sln
Updates MSBUILD/SS14.* to MSBUILD/Robust.*
Updates CSProject and MSBuild references for the above
Updates git_helper.py
Removes Runserver and Runclient as they are unusable
2019-04-15 20:24:59 -06:00