Commit Graph

26 Commits

Author SHA1 Message Date
metalgearsloth
021845d956 Add some System.Random methods (#5177)
* Add some System.Random methods

* weh
2024-06-20 17:23:47 +10:00
Fildrance
73c1449811 Add GetItems() extension for IRobustRandom (#4975)
* refactor: RobustRandom and RandomExtensions namespace change to file-scoped

* refactor: IRobustRandom xml-doc methods rearranged to be more structured.

* feat: GetItems methods added to RandomExtensions, tests for new methods added.

* fix: GetItems will not request count-1 from next random, as System.Random.Next have upper bound excluded.

* fix: enforced standard deviation on picking next items in RandomExtensions.GetItems + fixed hashet initial capacity +removed mandatory hashset allocation

* refactor: specified border values interaction in IRobustRandom xml-doc

* refactor: updated relese-notes

* refactor: changed release-notes PROPERLY

* fix: order by which unique random items are picked in RandomExtensions.GetItems were fixed to ACTUALLY follow normal distribution

* refractor: added comment for devious RandomExtensions.GetItems only-unique logic

* reduce code duplication

* Cleanup code a bit

Rename variables, and make it a bit more compact.
Also, IMO the description is unnecessary

* Remove obsolete extension

* Remove incorrect O(n) comments.

---------

Co-authored-by: pa.pecherskij <pa.pecherskij@interfax.ru>
2024-03-30 10:42:39 +11:00
metalgearsloth
5c1a5e9826 Add 2 random methods (#4980)
* Add 2 random methods

One for valuelist shuffle and one for NextAngle range.

* rn

* Fix RN
2024-03-24 14:00:21 +11:00
metalgearsloth
7592997f4e Add random pick / take methods for sets (#4821)
* Add random pick / take methods for sets

I want it don't at me.

* cleanup (mraow)

* Revert "cleanup (mraow)"

This reverts commit e279957f21.

* flatpak

* notes
2024-01-09 00:37:19 +11:00
metalgearsloth
e39b249070 Add gaussian extension for System.Random (#4776) 2023-12-31 05:26:39 +11:00
Leon Friedrich
89c1e90646 Add IRobustRandom.SetSeed() (#4606) 2023-11-25 15:32:16 -08:00
metalgearsloth
b486ef885c Add NextAngle for System.Random (#4522) 2023-10-29 04:22:32 +11:00
Tom Leys
d7962c7190 Add implementation of Random.Pick(ValueList<T> ..) (#4257) 2023-08-21 13:56:18 +10:00
metalgearsloth
7d1ad527d9 Replace Robust Vector2 with System.Numerics (#4092) 2023-07-08 14:08:26 +10:00
metalgearsloth
9bb61b8a35 Add NextByte to random methods (#4151) 2023-06-25 21:52:15 +10:00
pali
3f7fce2f02 Fix prob definition inequality (#3976) 2023-04-29 03:15:47 +10:00
metalgearsloth
410957be46 Random shuffle overrides (#3912) 2023-04-09 11:56:42 +10:00
metalgearsloth
2f7a652e22 Add helper methods for System.Random (#3832)
This might be a maint thing but look, I just want seeded RNG and IRobustRandom doesn't have it so not sure what is easier considering IRobustRandom is also registered as a depdency but constructing it manually is weird aaaa
2023-03-09 16:04:23 -06:00
Pieter-Jan Briers
84733a335c Prototype load parallelization (#3502) 2022-12-20 22:46:30 +01:00
metalgearsloth
81cd43f988 Random timespan support (#3458) 2022-11-10 23:32:52 +01:00
Leon Friedrich
e07a4e516c Add random vector functions to IRobustRandom (#2551) 2022-02-17 18:05:12 +11: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
metalgearsloth
43081c57e7 Add acruid's funny entity query (#2440) 2022-01-21 10:45:10 +11:00
Paul Ritter
726bfd58f6 adds some helpers to robustrandom (#1969)
Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
2021-08-23 20:32:51 +02: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
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
Víctor Aguilera Puerto
44bcbfa8e5 Misc changed needed for atmos (#1186)
* Add needed changes for atmos

* Get delays for RSI state

* Placement hijack can handle deletion on gridcoordinates

* Array serialization

* MapIndices to GridCoordinates

* CollidableComponent creates VirtualControllers using IDynamicTypeFactory

* Probability assert now prints chance

* Remove unused stuff, fix build

* Update documentation for map indices

* readability

* Removed unused using statements

* Remove ToAngle

* Fix messed up merge

* Fix MapIndices/GridCoordinates conversion

* Add "invalid" direction.

* Update Robust.Shared/Serialization/YamlObjectSerializer.cs

* Nullable fix

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2020-08-02 18:39:23 +02:00
Pieter-Jan Briers
2b3bdf0f28 Adds RandomExtensions.Pick for IReadOnlyCollection. 2020-05-23 00:42:37 +02:00
Pieter-Jan Briers
7dfae37451 no more Prob(80).
Adds assert against that so you don't screw up from BYOND habits.
2020-03-25 18:01:49 +01:00
DamianX
943b000950 Things for wires (#852)
* Things for wires

* Fixed things
2019-08-25 23:18:03 +02:00
DamianX
7f9f593989 Implemented RobustRandom (#845)
* Implemented RobustRandom

* Fixed RandomString
2019-08-16 21:43:59 +02:00