This repository was archived by the owner on Nov 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 10 files changed +632
-9
lines changed
Expand file tree Collapse file tree 10 files changed +632
-9
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1313// See the License for the specific language governing permissions and
1414// limitations under the License.
1515
16- using System ;
1716using System . IO ;
1817
19- namespace QuantumBranch . OpenSharedLibrary
18+ namespace OpenSharedLibrary
2019{
2120 /// <summary>
2221 /// Byte array container class
Original file line number Diff line number Diff line change 1+
2+ // Copyright 2019 Nikita Fediuchin (QuantumBranch)
3+ //
4+ // Licensed under the Apache License, Version 2.0 (the "License");
5+ // you may not use this file except in compliance with the License.
6+ // You may obtain a copy of the License at
7+ //
8+ // http://www.apache.org/licenses/LICENSE-2.0
9+ //
10+ // Unless required by applicable law or agreed to in writing, software
11+ // distributed under the License is distributed on an "AS IS" BASIS,
12+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ // See the License for the specific language governing permissions and
14+ // limitations under the License.
15+
16+ using System ;
17+
18+ namespace OpenSharedLibrary
19+ {
20+ /// <summary>
21+ /// Chance container structure (from 0.0f to 100.0f)
22+ /// </summary>
23+ public struct Chance
24+ {
25+ /// <summary>
26+ /// Chance value
27+ /// </summary>
28+ private readonly float value ;
29+
30+ /// <summary>
31+ /// Creates a new chance structure instance
32+ /// </summary>
33+ public Chance ( float value )
34+ {
35+ if ( value < 0.0f || value > 100.0f )
36+ throw new ArgumentOutOfRangeException ( nameof ( value ) ) ;
37+
38+ this . value = value ;
39+ }
40+
41+ /// <summary>
42+ /// Returns chance value
43+ /// </summary>
44+ public static implicit operator float ( Chance chance )
45+ {
46+ return chance . value ;
47+ }
48+ /// <summary>
49+ /// Returns chance value
50+ /// </summary>
51+ public static implicit operator Chance ( float value )
52+ {
53+ return new Chance ( value ) ;
54+ }
55+ }
56+ }
Original file line number Diff line number Diff line change 1818using System . Net . Mail ;
1919using System . Text ;
2020
21- namespace QuantumBranch . OpenSharedLibrary
21+ namespace OpenSharedLibrary
2222{
2323 /// <summary>
2424 /// Email adderss container
Original file line number Diff line number Diff line change 1818using System . Numerics ;
1919using System . Text ;
2020
21- namespace QuantumBranch . OpenSharedLibrary
21+ namespace OpenSharedLibrary
2222{
2323 /// <summary>
2424 /// Password hash container
Original file line number Diff line number Diff line change 1616using System ;
1717using System . IO ;
1818
19- namespace QuantumBranch . OpenSharedLibrary
19+ namespace OpenSharedLibrary
2020{
2121 /// <summary>
2222 /// Token container class
Original file line number Diff line number Diff line change 1717using System . IO ;
1818using System . Text ;
1919
20- namespace QuantumBranch . OpenSharedLibrary
20+ namespace OpenSharedLibrary
2121{
2222 /// <summary>
2323 /// Alphanumeric lowercase username container (with "_")
Original file line number Diff line number Diff line change 1515
1616using System . IO ;
1717
18- namespace QuantumBranch . OpenSharedLibrary
18+ namespace OpenSharedLibrary
1919{
2020 /// <summary>
2121 /// Byte array interface
Original file line number Diff line number Diff line change 1616using System . Security . Cryptography ;
1717using System . Text ;
1818
19- namespace QuantumBranch . OpenSharedLibrary
19+ namespace OpenSharedLibrary
2020{
2121 /// <summary>
2222 /// Cryptography usefull method container class
Original file line number Diff line number Diff line change 1616using System . IO ;
1717using System . Numerics ;
1818
19- namespace QuantumBranch . OpenSharedLibrary
19+ namespace OpenSharedLibrary
2020{
2121 /// <summary>
2222 /// Vector classes extension container class
You can’t perform that action at this time.
0 commit comments