Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ShipObject
- {
- }
- public class ShipsContainer
- {
- private Dictionary<int, ShipObject> m_ShipDict;
- public void AddShip(ShipObject ship)
- {
- m_ShipDict.Add (ship.GetHashCode (), ship);
- }
- public ShipObject GetShipByHash(int hash)
- {
- return m_ShipDict [hash];
- }
- public void RemoveShip(int hash)
- {
- if (m_ShipDict.ContainsKey (hash))
- {
- m_ShipDict.Remove (hash);
- return;
- }
- Debug.Log ("Ship not found!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement