Esempio n. 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (UserId != 0)
            {
                hash ^= UserId.GetHashCode();
            }
            if (UserName.Length != 0)
            {
                hash ^= UserName.GetHashCode();
            }
            if (UserHead != 0)
            {
                hash ^= UserHead.GetHashCode();
            }
            if (LastLoginTime != 0L)
            {
                hash ^= LastLoginTime.GetHashCode();
            }
            if (CardNum != 0)
            {
                hash ^= CardNum.GetHashCode();
            }
            if (DepartmentLevel != 0)
            {
                hash ^= DepartmentLevel.GetHashCode();
            }
            return(hash);
        }
Esempio n. 2
0
    public void UE_Click()
    {
        GameHead.instance.universeData = _data.universeData;
        _components.wUIMenuBuildSelectObject.Inspect(
            _data.clickAction,

            _data.universeData.name,

            (string name) =>
        {
            _data.universeData.name    = name;
            _components.nameLabel.text = name;
            UserHead.SaveAllUsersData();
        },
            () =>
        {
            wUI.user.userData.universeDatas.Remove(_data.universeData);
            if (wUI.user.userData.universeDatas.Count == 0)
            {
                wUI.UnstackCurrent();
            }

            UserHead.SaveAllUsersData();
            Destroy(base.gameObject);

            wUI.user.SaveData();
        },
            () =>
        {
            wUI.user.userData.universeDatas.Add(new UniverseData(_data.universeData));
            wUI.user.SaveData();
            _components.parent.Inspect(wUI.user.userData.universeDatas);
        }
            );
    }
Esempio n. 3
0
    public void UE_Click()
    {
        // mb find better way to enumerate :/
        Action moveToAction = null;

        if (_data.editableData is SandboxObjectData)
        {
            moveToAction = () =>
            {
                ((EntryWUI)wUI).Move(_data.editableData);
            };
        }

        _components.wUIMenuBuildSelectObject.Inspect(() =>
        {
            EditorHead.instance.Edit(_data.universeData, _data.editableData);
        },

                                                     _data.editableData.name,

                                                     (string name) =>
        {
            _data.editableData.name    = name;
            _components.nameLabel.text = name;
            UserHead.SaveAllUsersData();
        },
                                                     () =>
        {
            if (_data.editableData is SandboxObjectData)
            {
                _data.universeData.objects.Remove(_data.editableData);
            }
            else
            {
                _data.universeData.maps.Remove(_data.editableData);
            }
            UserHead.SaveAllUsersData();
            Destroy(base.gameObject);

            UserHead.SaveAllUsersData();
        },
                                                     () =>
        {
            if (_data.editableData is SandboxObjectData)
            {
                _data.universeData.objects.Add(new SandboxObjectData((SandboxObjectData)_data.editableData));
            }
            else
            {
                _data.universeData.maps.Add(new SandboxData((SandboxData)_data.editableData));
            }

            UserHead.SaveAllUsersData();
            _components.parent.Inspect(_data.universeData);
        },
                                                     moveToAction
                                                     );
    }
Esempio n. 4
0
    public void UE_NewGame()
    {
        UniverseData universeData = new UniverseData
        {
            name    = "test",
            maps    = new List <EditableData>(),
            objects = new List <EditableData>(),
        };

        wUI.user.userData.universeDatas.Add(universeData);
        _components.wUIMenuBuildEditExisting.Inspect(universeData);
        UserHead.SaveAllUsersData();
    }
Esempio n. 5
0
    public void UE_CreateNew()
    {
        if (_data.editorType == EditorType.Object)
        {
            SandboxObjectData sandboxObjectData = EditorHead.instance.NewSandboxObject(_data.universeData.GenerateUniqueId(), _data.universeData.GenerateUniqueId());
            sandboxObjectData.category = _data.activeCategory;
            _data.universeData.objects.Add(sandboxObjectData);
        }
        else
        {
            SandboxData sandboxData = EditorHead.instance.NewSandbox(_data.universeData.GenerateUniqueId());
            _data.universeData.maps.Add(sandboxData);
        }

        UserHead.SaveAllUsersData();
        Refresh();
    }
Esempio n. 6
0
 internal void SaveData()
 {
     UserHead.SaveUserData(this);
 }
Esempio n. 7
0
 private void Refresh()
 {
     UserHead.SaveAllUsersData();
     Populate(_data.editorType == EditorType.Map ? _data.universeData.maps : _data.universeData.objects);
 }
Esempio n. 8
0
 internal void Save()
 {
     editableData.modules = editable.GetModuleSaveData();
     UserHead.SaveAllUsersData();
 }
Esempio n. 9
0
 private void OnChooseCategory(string category)
 {
     _data.editableData.category = category;
     UserHead.SaveAllUsersData();
     Unstack();
 }