コード例 #1
0
ファイル: DomainModel.cs プロジェクト: jamClark/Stellarmap
        public void StoreView(string roomName, RoomUpdateInfo info)
        {
            //System.Diagnostics.Debug.Assert(roomName != null && roomName != "" && info != null);
            if (roomName.Length < 1 || roomName == null)
            {
                return;
            }

            if (!RoomNameMap.ContainsKey(roomName))
            {
                throw new DomainModelException("Room could not be found: " + roomName);
            }

            RoomNameMap[roomName].FunctionCalls = info.Functions;
            RoomNameMap[roomName].EditorState   = info.EditorStates;
        }
コード例 #2
0
ファイル: DomainModel.cs プロジェクト: jamClark/Stellarmap
        public RoomUpdateInfo PropogateModelToView(string roomName)
        {
            //System.Diagnostics.Debug.Assert(roomName != null && roomName.Length != 0; roomName != "");
            if (roomName == null || roomName.Length < 1)
            {
                return(null);
            }

            if (!RoomNameMap.ContainsKey(roomName))
            {
                throw new DomainModelException("Room could not be found: " + roomName);
            }

            RoomUpdateInfo info = new RoomUpdateInfo();

            info.Functions    = RoomNameMap[roomName].FunctionCalls;
            info.EditorStates = RoomNameMap[roomName].EditorState;
            return(info);
        }