Ejemplo n.º 1
0
 public void ReadFromGame(NetLaneProps.Prop gameProp)
 {
     DTOUtil.CopyAllMatchingFields <Prop>(this, gameProp);
     MetaData = gameProp.GetMetaData()?.Clone();
     //Log.Debug($"ReadFromGame: m_prop={this.m_prop?.name_} " +
     //    $"gameProp.m_prop={gameProp?.m_prop}");
 }
Ejemplo n.º 2
0
 public void WriteToGame(NetInfo.Lane gameLane)
 {
     DTOUtil.CopyAllMatchingFields <Lane>(gameLane, this);
     gameLane.m_laneProps = new NetLaneProps {
         m_props = DTOUtil.CopyArray <NetLaneProps.Prop>(m_props)
     };
 }
Ejemplo n.º 3
0
 public void ReadFromGame(NetInfo info)
 {
     DTOUtil.CopyAllMatchingFields <NetInfoDTO>(this, info);
     MetaData   = info.GetMetaData().Clone();
     m_lanes    = DTOUtil.CopyArray <Lane>(info.m_lanes);
     m_segments = DTOUtil.CopyArray <Segment>(info.m_segments);
     m_nodes    = DTOUtil.CopyArray <Node>(info.m_nodes);
 }
Ejemplo n.º 4
0
 public void WriteToGame(NetLaneProps.Prop gameProp)
 {
     DTOUtil.CopyAllMatchingFields <Prop>(gameProp, this);
     gameProp.m_finalProp = gameProp.m_prop;
     gameProp.m_finalTree = gameProp.m_tree;
     (gameProp as IInfoExtended)?.SetMetaData(MetaData?.Clone());
     //Log.Debug($"WriteToGame: m_prop={this.m_prop?.name_} " +
     //    $"gameProp.m_finalProp={gameProp.m_finalProp}");
 }
Ejemplo n.º 5
0
 public void WriteToGame(NetInfo info)
 {
     if (info == null)
     {
         return;
     }
     DTOUtil.CopyAllMatchingFields <NetInfoDTO>(info, this);
     info.m_lanes    = DTOUtil.CopyArray <NetInfo.Lane>(m_lanes);
     info.m_segments = DTOUtil.CopyArray <NetInfo.Segment>(m_segments);
     info.m_nodes    = DTOUtil.CopyArray <NetInfo.Node>(m_nodes);
     info.SetMetedata(MetaData?.Clone());
 }
Ejemplo n.º 6
0
        public void ReadFromGame(NetInfo game_basic)
        {
            NetInfo game_elevated = AssetEditorRoadUtils.TryGetElevated(game_basic);
            NetInfo game_bridge   = AssetEditorRoadUtils.TryGetBridge(game_basic);
            NetInfo game_slope    = AssetEditorRoadUtils.TryGetSlope(game_basic);
            NetInfo game_tunnel   = AssetEditorRoadUtils.TryGetTunnel(game_basic);

            basic   = new NetInfoDTO();
            basicAI = new RoadAIDTO();
            basic.ReadFromGame(game_basic);
            DTOUtil.CopyAllMatchingFields <RoadAIDTO>(basicAI, game_basic.m_netAI);

            if (game_elevated)
            {
                elevated = new NetInfoDTO();
                elevated.ReadFromGame(game_elevated);
                elevatedAI = new BridgeAIDTO();
                DTOUtil.CopyAllMatchingFields <BridgeAIDTO>(elevatedAI, game_elevated.m_netAI);
            }
            if (game_bridge)
            {
                bridge = new NetInfoDTO();
                bridge.ReadFromGame(game_bridge);
                bridgeAI = new BridgeAIDTO();
                DTOUtil.CopyAllMatchingFields <BridgeAIDTO>(bridgeAI, game_bridge.m_netAI);
            }
            if (game_slope)
            {
                slope = new NetInfoDTO();
                slope.ReadFromGame(game_slope);
                slopeAI = new TunnelAIDTO();
                DTOUtil.CopyAllMatchingFields <TunnelAIDTO>(slopeAI, game_slope.m_netAI);
            }
            if (game_tunnel)
            {
                tunnel = new NetInfoDTO();
                tunnel.ReadFromGame(game_tunnel);
                tunnelAI = new TunnelAIDTO();
                DTOUtil.CopyAllMatchingFields <TunnelAIDTO>(tunnelAI, game_tunnel.m_netAI);
            }

            //basicModel.Read(game_basic, "Basic");
            //elevatedModel.Read(gameRoadAI.m_elevatedInfo, "Elevated");
            //bridgeModel.Read(gameRoadAI.m_bridgeInfo, "Bridge");
            //slopeModel.Read(gameRoadAI.m_slopeInfo, "Slope");
            //tunnelModel.Read(gameRoadAI.m_tunnelInfo, "Tunnel");
        }
Ejemplo n.º 7
0
        public void WriteToGame(NetInfo game_basic)
        {
            NetInfo game_elevated = AssetEditorRoadUtils.TryGetElevated(game_basic);
            NetInfo game_bridge   = AssetEditorRoadUtils.TryGetBridge(game_basic);
            NetInfo game_slope    = AssetEditorRoadUtils.TryGetSlope(game_basic);
            NetInfo game_tunnel   = AssetEditorRoadUtils.TryGetTunnel(game_basic);

            basic.WriteToGame(game_basic);
            elevated?.WriteToGame(game_elevated);
            bridge?.WriteToGame(game_bridge);
            slope?.WriteToGame(game_slope);
            tunnel?.WriteToGame(game_tunnel);

            DTOUtil.CopyAllMatchingFields <RoadAIDTO>(game_basic.m_netAI, basicAI);
            DTOUtil.CopyAllMatchingFields <BridgeAIDTO>(game_elevated.m_netAI, elevatedAI);
            DTOUtil.CopyAllMatchingFields <BridgeAIDTO>(game_bridge.m_netAI, bridgeAI);
            DTOUtil.CopyAllMatchingFields <TunnelAIDTO>(game_slope.m_netAI, slopeAI);
            DTOUtil.CopyAllMatchingFields <TunnelAIDTO>(game_tunnel.m_netAI, tunnelAI);
        }
Ejemplo n.º 8
0
 public void WriteToGame(NetInfo.Node gameNode)
 {
     DTOUtil.CopyAllMatchingFields <Node>(gameNode, this);
     (gameNode as IInfoExtended)?.SetMetaData(MetaData?.Clone());
 }
Ejemplo n.º 9
0
 public void ReadFromGame(NetInfo.Node gameNode)
 {
     DTOUtil.CopyAllMatchingFields <Node>(this, gameNode);
     MetaData = gameNode.GetMetaData()?.Clone();
 }
Ejemplo n.º 10
0
 public void ReadFromGame(NetInfo.Lane gameLane)
 {
     DTOUtil.CopyAllMatchingFields <Lane>(this, gameLane);
     this.m_props = DTOUtil.CopyArray <Prop>(gameLane.m_laneProps.m_props);
 }
Ejemplo n.º 11
0
 public void WriteToGame(NetInfo.Segment gameSegment)
 {
     DTOUtil.CopyAllMatchingFields <Segment>(gameSegment, this);
     (gameSegment as IInfoExtended)?.SetMetaData(MetaData?.Clone());
 }
Ejemplo n.º 12
0
 public void ReadFromGame(NetInfo.Segment gameSegment)
 {
     DTOUtil.CopyAllMatchingFields <Segment>(this, gameSegment);
     MetaData = gameSegment.GetMetaData()?.Clone();
 }