Skip to content

Commit 791112f

Browse files
Added namespaces
1 parent bf909a2 commit 791112f

File tree

166 files changed

+2979
-2481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+2979
-2481
lines changed

Assets/SO Architecture/Collections/BaseCollection.cs

+24-21
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,34 @@
33
using UnityEngine;
44
using Type = System.Type;
55

6-
public abstract class BaseCollection : SOArchitectureBaseObject, IEnumerable
6+
namespace ScriptableObjectArchitecture
77
{
8-
public object this[int index]
8+
public abstract class BaseCollection : SOArchitectureBaseObject, IEnumerable
99
{
10-
get
10+
public object this[int index]
1111
{
12-
return List[index];
12+
get
13+
{
14+
return List[index];
15+
}
16+
set
17+
{
18+
List[index] = value;
19+
}
1320
}
14-
set
15-
{
16-
List[index] = value;
17-
}
18-
}
1921

20-
public int Count { get { return List.Count; } }
22+
public int Count { get { return List.Count; } }
2123

22-
public abstract IList List { get; }
23-
public abstract Type Type { get; }
24-
25-
IEnumerator IEnumerable.GetEnumerator()
26-
{
27-
return List.GetEnumerator();
28-
}
29-
public bool Contains(object obj)
30-
{
31-
return List.Contains(obj);
32-
}
24+
public abstract IList List { get; }
25+
public abstract Type Type { get; }
26+
27+
IEnumerator IEnumerable.GetEnumerator()
28+
{
29+
return List.GetEnumerator();
30+
}
31+
public bool Contains(object obj)
32+
{
33+
return List.Contains(obj);
34+
}
35+
}
3336
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using UnityEngine;
22

3-
[CreateAssetMenu(
4-
fileName = "BoolCollection.asset",
5-
menuName = SOArchitecture_Utility.COLLECTION_SUBMENU + "bool",
6-
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 5)]
7-
public class BoolCollection : Collection<bool>
3+
namespace ScriptableObjectArchitecture
84
{
5+
[CreateAssetMenu(
6+
fileName = "BoolCollection.asset",
7+
menuName = SOArchitecture_Utility.COLLECTION_SUBMENU + "bool",
8+
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 5)]
9+
public class BoolCollection : Collection<bool>
10+
{
11+
}
912
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using UnityEngine;
22

3-
[CreateAssetMenu(
4-
fileName = "ByteCollection.asset",
5-
menuName = SOArchitecture_Utility.ADVANCED_VARIABLE_COLLECTION + "byte",
6-
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 6)]
7-
public class ByteCollection : Collection<byte>
3+
namespace ScriptableObjectArchitecture
84
{
5+
[CreateAssetMenu(
6+
fileName = "ByteCollection.asset",
7+
menuName = SOArchitecture_Utility.ADVANCED_VARIABLE_COLLECTION + "byte",
8+
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 6)]
9+
public class ByteCollection : Collection<byte>
10+
{
11+
}
912
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using UnityEngine;
22

3-
[CreateAssetMenu(
4-
fileName = "CharCollection.asset",
5-
menuName = SOArchitecture_Utility.ADVANCED_VARIABLE_COLLECTION + "char",
6-
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 7)]
7-
public class CharCollection : Collection<char>
3+
namespace ScriptableObjectArchitecture
84
{
5+
[CreateAssetMenu(
6+
fileName = "CharCollection.asset",
7+
menuName = SOArchitecture_Utility.ADVANCED_VARIABLE_COLLECTION + "char",
8+
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 7)]
9+
public class CharCollection : Collection<char>
10+
{
11+
}
912
}

Assets/SO Architecture/Collections/Collection.cs

+66-63
Original file line numberDiff line numberDiff line change
@@ -3,78 +3,81 @@
33
using System.Collections.Generic;
44
using UnityEngine;
55

6-
public class Collection<T> : BaseCollection, IEnumerable<T>
6+
namespace ScriptableObjectArchitecture
77
{
8-
public new T this[int index]
8+
public class Collection<T> : BaseCollection, IEnumerable<T>
99
{
10-
get
10+
public new T this[int index]
1111
{
12-
return _list[index];
12+
get
13+
{
14+
return _list[index];
15+
}
16+
set
17+
{
18+
_list[index] = value;
19+
}
1320
}
14-
set
15-
{
16-
_list[index] = value;
17-
}
18-
}
1921

20-
[SerializeField]
21-
private List<T> _list = new List<T>();
22+
[SerializeField]
23+
private List<T> _list = new List<T>();
2224

23-
public override IList List
24-
{
25-
get
25+
public override IList List
2626
{
27-
return _list;
27+
get
28+
{
29+
return _list;
30+
}
2831
}
29-
}
30-
public override Type Type
31-
{
32-
get
32+
public override Type Type
3333
{
34-
return typeof(T);
34+
get
35+
{
36+
return typeof(T);
37+
}
3538
}
36-
}
3739

38-
public void Add(T obj)
39-
{
40-
if (!_list.Contains(obj))
41-
_list.Add(obj);
42-
}
43-
public void Remove(T obj)
44-
{
45-
if (_list.Contains(obj))
46-
_list.Remove(obj);
47-
}
48-
public void Clear()
49-
{
50-
_list.Clear();
51-
}
52-
public bool Contains(T value)
53-
{
54-
return _list.Contains(value);
55-
}
56-
public int IndexOf(T value)
57-
{
58-
return _list.IndexOf(value);
59-
}
60-
public void RemoveAt(int index)
61-
{
62-
_list.RemoveAt(index);
63-
}
64-
public void Insert(int index, T value)
65-
{
66-
_list.Insert(index, value);
67-
}
68-
IEnumerator IEnumerable.GetEnumerator()
69-
{
70-
return GetEnumerator();
71-
}
72-
public IEnumerator<T> GetEnumerator()
73-
{
74-
return _list.GetEnumerator();
75-
}
76-
public override string ToString()
77-
{
78-
return "Collection<" + typeof(T) + ">(" + Count + ")";
79-
}
40+
public void Add(T obj)
41+
{
42+
if (!_list.Contains(obj))
43+
_list.Add(obj);
44+
}
45+
public void Remove(T obj)
46+
{
47+
if (_list.Contains(obj))
48+
_list.Remove(obj);
49+
}
50+
public void Clear()
51+
{
52+
_list.Clear();
53+
}
54+
public bool Contains(T value)
55+
{
56+
return _list.Contains(value);
57+
}
58+
public int IndexOf(T value)
59+
{
60+
return _list.IndexOf(value);
61+
}
62+
public void RemoveAt(int index)
63+
{
64+
_list.RemoveAt(index);
65+
}
66+
public void Insert(int index, T value)
67+
{
68+
_list.Insert(index, value);
69+
}
70+
IEnumerator IEnumerable.GetEnumerator()
71+
{
72+
return GetEnumerator();
73+
}
74+
public IEnumerator<T> GetEnumerator()
75+
{
76+
return _list.GetEnumerator();
77+
}
78+
public override string ToString()
79+
{
80+
return "Collection<" + typeof(T) + ">(" + Count + ")";
81+
}
82+
}
8083
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using UnityEngine;
22

3-
[CreateAssetMenu(
4-
fileName = "DoubleCollection.asset",
5-
menuName = SOArchitecture_Utility.ADVANCED_VARIABLE_COLLECTION + "double",
6-
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 8)]
7-
public class DoubleCollection : Collection<double>
3+
namespace ScriptableObjectArchitecture
84
{
5+
[CreateAssetMenu(
6+
fileName = "DoubleCollection.asset",
7+
menuName = SOArchitecture_Utility.ADVANCED_VARIABLE_COLLECTION + "double",
8+
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 8)]
9+
public class DoubleCollection : Collection<double>
10+
{
11+
}
912
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using UnityEngine;
22

3-
[CreateAssetMenu(
4-
fileName = "FloatCollection.asset",
5-
menuName = SOArchitecture_Utility.COLLECTION_SUBMENU + "float",
6-
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 3)]
7-
public class FloatCollection : Collection<float>
3+
namespace ScriptableObjectArchitecture
84
{
5+
[CreateAssetMenu(
6+
fileName = "FloatCollection.asset",
7+
menuName = SOArchitecture_Utility.COLLECTION_SUBMENU + "float",
8+
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 3)]
9+
public class FloatCollection : Collection<float>
10+
{
11+
}
912
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using UnityEngine;
22

3-
[CreateAssetMenu(
4-
fileName = "GameObjectCollection.asset",
5-
menuName = SOArchitecture_Utility.COLLECTION_SUBMENU + "GameObject",
6-
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 0)]
7-
public class GameObjectCollection : Collection<GameObject>
3+
namespace ScriptableObjectArchitecture
84
{
5+
[CreateAssetMenu(
6+
fileName = "GameObjectCollection.asset",
7+
menuName = SOArchitecture_Utility.COLLECTION_SUBMENU + "GameObject",
8+
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 0)]
9+
public class GameObjectCollection : Collection<GameObject>
10+
{
11+
}
912
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using UnityEngine;
22

3-
[CreateAssetMenu(
4-
fileName = "IntCollection.asset",
5-
menuName = SOArchitecture_Utility.COLLECTION_SUBMENU + "int",
6-
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 4)]
7-
public class IntCollection : Collection<int>
3+
namespace ScriptableObjectArchitecture
84
{
5+
[CreateAssetMenu(
6+
fileName = "IntCollection.asset",
7+
menuName = SOArchitecture_Utility.COLLECTION_SUBMENU + "int",
8+
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 4)]
9+
public class IntCollection : Collection<int>
10+
{
11+
}
912
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using UnityEngine;
22

3-
[CreateAssetMenu(
4-
fileName = "LongCollection.asset",
5-
menuName = SOArchitecture_Utility.ADVANCED_VARIABLE_COLLECTION + "long",
6-
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 9)]
7-
public class LongCollection : Collection<long>
3+
namespace ScriptableObjectArchitecture
84
{
5+
[CreateAssetMenu(
6+
fileName = "LongCollection.asset",
7+
menuName = SOArchitecture_Utility.ADVANCED_VARIABLE_COLLECTION + "long",
8+
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 9)]
9+
public class LongCollection : Collection<long>
10+
{
11+
}
912
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using UnityEngine;
22

3-
[CreateAssetMenu(
4-
fileName = "ObjectCollection.asset",
5-
menuName = SOArchitecture_Utility.COLLECTION_SUBMENU + "Object",
6-
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 1)]
7-
public class ObjectCollection : Collection<Object>
3+
namespace ScriptableObjectArchitecture
84
{
5+
[CreateAssetMenu(
6+
fileName = "ObjectCollection.asset",
7+
menuName = SOArchitecture_Utility.COLLECTION_SUBMENU + "Object",
8+
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 1)]
9+
public class ObjectCollection : Collection<Object>
10+
{
11+
}
912
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using UnityEngine;
22

3-
[CreateAssetMenu(
4-
fileName = "QuaternionCollection.asset",
5-
menuName = SOArchitecture_Utility.COLLECTION_SUBMENU + "Structs/Quaternion",
6-
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 13)]
7-
public class QuaternionCollection : Collection<Quaternion>
3+
namespace ScriptableObjectArchitecture
84
{
5+
[CreateAssetMenu(
6+
fileName = "QuaternionCollection.asset",
7+
menuName = SOArchitecture_Utility.COLLECTION_SUBMENU + "Structs/Quaternion",
8+
order = SOArchitecture_Utility.ASSET_MENU_ORDER_COLLECTIONS + 13)]
9+
public class QuaternionCollection : Collection<Quaternion>
10+
{
11+
}
912
}

0 commit comments

Comments
 (0)