原文:重新想象 Windows 8 Store Apps (13) - 控件之 SemanticZoom

[源码下载]

重新想象 Windows 8 Store Apps (13) - 控件之 SemanticZoom

作者:webabcd

介绍
重新想象 Windows 8 Store Apps 之 SemanticZoom

  • 演示 SemanticZoom 的应用
  • 通过 ISemanticZoomInformation 接口实现自定义 SemanticZoom 的 View

示例
1、演示 SemanticZoom 的应用
Index.xaml

  1. <Page
  2. x:Class="XamlDemo.Index"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:local="using:XamlDemo"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. mc:Ignorable="d">
  9.  
  10. <Grid Background="Transparent">
  11.  
  12. <SemanticZoom x:Name="semanticZoom" HorizontalAlignment="Left">
  13. <!--
  14. 放大后的视图,详细数据
  15. -->
  16. <SemanticZoom.ZoomedInView>
  17. <GridView x:Name="gridViewDetails" SelectionMode="None" IsSwipeEnabled="false" Padding="120 0 0 0">
  18.  
  19. <!--分组后,details 的数据模板-->
  20. <GridView.ItemTemplate>
  21. <DataTemplate>
  22. <Grid Background="#022a56" Width="200" Height="65" Tapped="Grid_Tapped_1" Tag="{Binding}">
  23. <TextBlock TextWrapping="Wrap" FontSize="14.667" Foreground="#ffffff" Padding="5 0"
  24. HorizontalAlignment="Left" VerticalAlignment="Center"
  25. Text="{Binding Title}"/>
  26. </Grid>
  27. </DataTemplate>
  28. </GridView.ItemTemplate>
  29. <!--分组的样式-->
  30. <GridView.GroupStyle>
  31. <GroupStyle>
  32. <!--分组后,header 的数据模板-->
  33. <GroupStyle.HeaderTemplate>
  34. <DataTemplate>
  35. <TextBlock Text="{Binding Title}" FontSize="26.67" Height="30" Margin="0 0 0 20" />
  36. </DataTemplate>
  37. </GroupStyle.HeaderTemplate>
  38. <!--分组后,每组数据(包括 header 和 details)的样式-->
  39. <GroupStyle.ContainerStyle>
  40. <Style TargetType="GroupItem">
  41. <Setter Property="Template">
  42. <Setter.Value>
  43. <ControlTemplate TargetType="GroupItem">
  44. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  45. <Grid>
  46. <Grid.RowDefinitions>
  47. <RowDefinition Height="Auto"/>
  48. <RowDefinition Height="*"/>
  49. </Grid.RowDefinitions>
  50. <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}"/>
  51. <!--
  52. 每组数据的 details 数据源来自 ICollectionViewGroup.GroupItems
  53. -->
  54. <ItemsControl x:Name="ItemsControl" ItemsSource="{Binding GroupItems}" Grid.Row="1"/>
  55. </Grid>
  56. </Border>
  57. </ControlTemplate>
  58. </Setter.Value>
  59. </Setter>
  60. </Style>
  61. </GroupStyle.ContainerStyle>
  62. <!--分组后,每组数据(包括 header 和 details)的 panel-->
  63. <GroupStyle.Panel>
  64. <ItemsPanelTemplate>
  65. <VariableSizedWrapGrid Orientation="Vertical" Margin="0 0 50 0" ItemHeight="75" Loaded="VariableSizedWrapGrid_Loaded_1" />
  66. </ItemsPanelTemplate>
  67. </GroupStyle.Panel>
  68. </GroupStyle>
  69. </GridView.GroupStyle>
  70. <!--整体数据(一组数据算一个元素)的 panel-->
  71. <GridView.ItemsPanel>
  72. <ItemsPanelTemplate>
  73. <StackPanel Orientation="Horizontal" />
  74. </ItemsPanelTemplate>
  75. </GridView.ItemsPanel>
  76. </GridView>
  77. </SemanticZoom.ZoomedInView>
  78.  
  79. <!--
  80. 缩小后的视图,概述数据
  81. -->
  82. <SemanticZoom.ZoomedOutView>
  83. <GridView Name="gridViewSummary" HorizontalAlignment="Left" Padding="120 0 0 0">
  84. <GridView.ItemTemplate>
  85. <DataTemplate>
  86. <Grid Background="#022a56" Width="100" Height="100">
  87. <!--
  88. 每组数据的 header 数据源来自 ICollectionViewGroup.Group
  89. -->
  90. <TextBlock Text="{Binding Group.Title}" Foreground="#ffffff" Opacity="0.9" FontSize="14.667" Margin="5" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" />
  91. </Grid>
  92. </DataTemplate>
  93. </GridView.ItemTemplate>
  94. <GridView.ItemsPanel>
  95. <ItemsPanelTemplate>
  96. <WrapGrid MaximumRowsOrColumns="8" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal" />
  97. </ItemsPanelTemplate>
  98. </GridView.ItemsPanel>
  99. <GridView.ItemContainerStyle>
  100. <Style TargetType="GridViewItem">
  101. <Setter Property="Margin" Value="5 5 5 30" />
  102. <Setter Property="HorizontalContentAlignment" Value="Center" />
  103. <Setter Property="VerticalContentAlignment" Value="Center" />
  104. </Style>
  105. </GridView.ItemContainerStyle>
  106. </GridView>
  107. </SemanticZoom.ZoomedOutView>
  108. </SemanticZoom>
  109. </Grid>
  110. </Page>

Index.xaml.cs

  1. /*
  2. * 本页为此 app 的导航页,同时用于演示:
  3. * 1、ItemsControl 控件如何分组
  4. * 2、SemanticZoom 控件的应用
  5. *
  6. *
  7. * SemanticZoom - 用于关联两个有语义关系的视图
  8. * ZoomedInView - 放大后的视图,详细数据
  9. * ZoomedOutView - 缩小后的视图,概述数据
  10. * IsZoomedInViewActive - ZoomedInView 是否为当前正在显示的视图
  11. * CanChangeViews - 是否可在两个视图间切换
  12. * IsZoomOutButtonEnabled - 是否显示用于切换视图的按钮
  13. * ToggleActiveView() - 切换视图
  14. * ViewChangeStarted - 视图开始切换时触发的事件
  15. * ViewChangeCompleted - 视图切换完成时触发的事件
  16. *
  17. *
  18. * ItemsControl - 一个用于呈现集合数据的控件(GridView, ListView, FlipView, ListBox 等均直接或间接地继承了 ItemsControl)
  19. * ItemsControl 控件提供了分组功能
  20. *
  21. * CollectionViewSource - 对集合数据启用分组支持
  22. * Source - 数据源
  23. * View - 获取视图对象,返回一个实现了 ICollectionView 接口的对象
  24. * IsSourceGrouped - 数据源是否是一个被分组的数据
  25. * ItemsPath - 数据源中,子数据集合的属性名称
  26. *
  27. * ICollectionView - 支持数据分组
  28. * CollectionGroups - 组数据集合
  29. */
  30.  
  31. using System;
  32. using System.Collections.Generic;
  33. using System.Linq;
  34. using System.Xml.Linq;
  35. using Windows.UI.Core;
  36. using Windows.UI.Xaml;
  37. using Windows.UI.Xaml.Controls;
  38. using Windows.UI.Xaml.Data;
  39. using Windows.UI.Xaml.Input;
  40. using Windows.UI.Xaml.Navigation;
  41. using XamlDemo.Common;
  42.  
  43. namespace XamlDemo
  44. {
  45. public sealed partial class Index : Page
  46. {
  47. // 本页所用到的 GridView 的水平方向上的滚动值
  48. private double _scrollViewerHorizontalOffset = ;
  49.  
  50. public Index()
  51. {
  52. this.InitializeComponent();
  53.  
  54. XElement root = XElement.Load("SiteMap.xml");
  55. var items = LoadData(root);
  56.  
  57. // 构造数据源
  58. CollectionViewSource groupedNavigationData = new CollectionViewSource();
  59. groupedNavigationData.IsSourceGrouped = true;
  60. groupedNavigationData.Source = items;
  61. groupedNavigationData.ItemsPath = new PropertyPath("Items");
  62.  
  63. // 绑定数据
  64. gridViewDetails.ItemsSource = groupedNavigationData.View; // 全部数据
  65. gridViewSummary.ItemsSource = groupedNavigationData.View.CollectionGroups; // 关联的组数据集合
  66.  
  67. // 必须缓存此页
  68. this.NavigationCacheMode = NavigationCacheMode.Required;
  69.  
  70. gridViewDetails.Loaded += gridViewDetails_Loaded;
  71. }
  72.  
  73. // 导航到其它页之前,保存本页所用到的 GridView 的水平方向上的滚动值
  74. protected override void OnNavigatedFrom(NavigationEventArgs e)
  75. {
  76. var scrollViewer = Helper.GetVisualChild<ScrollViewer>(gridViewDetails);
  77. _scrollViewerHorizontalOffset = scrollViewer.HorizontalOffset;
  78. }
  79.  
  80. // GridView 加载之后,指定其水平方向上的滚动值
  81. void gridViewDetails_Loaded(object sender, RoutedEventArgs e)
  82. {
  83. var scrollViewer = Helper.GetVisualChild<ScrollViewer>(gridViewDetails);
  84. scrollViewer.ScrollToHorizontalOffset(_scrollViewerHorizontalOffset);
  85. }
  86.  
  87. // 获取数据
  88. private List<NavigationModel> LoadData(XElement root)
  89. {
  90. if (root == null)
  91. return null;
  92.  
  93. var items = from n in root.Elements("node")
  94. select new NavigationModel
  95. {
  96. Title = (string)n.Attribute("title"),
  97. Url = (string)n.Attribute("url"),
  98. Items = LoadData(n)
  99. };
  100.  
  101. return items.ToList();
  102. }
  103.  
  104. // 导航到指定的 Demo 页
  105. private void Grid_Tapped_1(object sender, TappedRoutedEventArgs e)
  106. {
  107. var model = (NavigationModel)(sender as Grid).Tag;
  108.  
  109. MainPage.Current.SubTitle = model.Title;
  110. MainPage.Current.Container.Navigate(Type.GetType(model.Url));
  111. }
  112.  
  113. // 根据屏幕的 height 调整 VariableSizedWrapGrid 的 MaximumRowsOrColumns
  114. // 本例会自动 wrap ,所以不需要以下逻辑,在需要的场景下可以用之
  115. private void VariableSizedWrapGrid_Loaded_1(object sender, RoutedEventArgs e)
  116. {
  117. /*
  118. var screenHeight = Window.Current.Bounds.Height; // CoreWindow.GetForCurrentThread().Bounds.Height
  119.  
  120. var vswg = sender as VariableSizedWrapGrid;
  121. vswg.MaximumRowsOrColumns = (int)((screenHeight - 200) / 75);
  122. */
  123. }
  124.  
  125. class NavigationModel
  126. {
  127. public string Title { get; set; }
  128. public string Url { get; set; }
  129. public List<NavigationModel> Items { get; set; }
  130. }
  131. }
  132. }

2、演示如何自定义 SemanticZoom 视图
SemanticZoom/MyFlipView.cs

  1. /*
  2. * 开发一个实现了 ISemanticZoomInformation 接口的自定义 FlipView
  3. */
  4.  
  5. using Windows.UI.Xaml.Controls;
  6. using Windows.UI.Xaml.Data;
  7.  
  8. namespace XamlDemo.Controls.SemanticZoom
  9. {
  10. public class MyFlipView : FlipView, ISemanticZoomInformation
  11. {
  12. public MyFlipView()
  13. : base()
  14. {
  15.  
  16. }
  17.  
  18. public void CompleteViewChange() { }
  19.  
  20. public void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination) { }
  21.  
  22. public void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination) { }
  23.  
  24. public void InitializeViewChange() { }
  25.  
  26. public bool IsActiveView { get; set; }
  27.  
  28. public bool IsZoomedInView { get; set; }
  29.  
  30. public Windows.UI.Xaml.Controls.SemanticZoom SemanticZoomOwner { get; set; }
  31.  
  32. public void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination) { }
  33.  
  34. /// <summary>
  35. /// ZoomedOutView -> ZoomedInView 时触发的事件
  36. /// </summary>
  37. /// <param name="source">在 ZoomedOutView 时被选中的数据</param>
  38. /// <param name="destination">需要传递给 ZoomedInView 的数据</param>
  39. public void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)
  40. {
  41. /*
  42. * 注:
  43. * GridView 和 ListView 均实现了 ISemanticZoomInformation 接口
  44. * 参见本 app 的关于 SemanticZoom 的 Demo,通过 CollectionViewSource 绑定数据即可使 SemanticZoom 中的两个视图进行有关联地切换
  45. * 此时此处的 source.Item 便为一个 ICollectionViewGroup 类型的数据,其有两个属性:Group 和 GroupItems
  46. */
  47.  
  48. // 获取在 ZoomedOutView 中被选中的项,即被选中的父亲
  49. NavigationModel model = source.Item as NavigationModel;
  50. // 将此父亲的所有子数据传递给 ZoomedInView,接下来会执行 MakeVisible() 方法
  51. destination.Item = model.Items;
  52. }
  53.  
  54. /// <summary>
  55. /// 开始 ZoomedOutView -> ZoomedInView 之后,会调用此方法
  56. /// 一般在此处重整 ZoomedInView 的数据源,或者滚动 ZoomedInView 中的内容到指定的项以对应 ZoomedOutView 中被选中的数据
  57. /// </summary>
  58. /// <param name="item">由 StartViewChangeTo() 方法传递给 ZoomedInView 的数据</param>
  59. public void MakeVisible(SemanticZoomLocation item)
  60. {
  61. // 将 FlipView 的数据源指定为被选中的父亲的所有子数据
  62. this.ItemsSource = item.Item;
  63. }
  64. }
  65. }

SemanticZoom/CustomView.xaml

  1. <Page
  2. x:Class="XamlDemo.Controls.SemanticZoom.CustomView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:local="using:XamlDemo.Controls.SemanticZoom"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. mc:Ignorable="d">
  9.  
  10. <Grid Background="Transparent">
  11. <SemanticZoom x:Name="semanticZoom" IsZoomedInViewActive="False" Margin="120 0 0 0">
  12. <!--
  13. 放大后的视图,详细数据
  14. -->
  15. <SemanticZoom.ZoomedInView>
  16. <local:MyFlipView x:Name="flipView" Width="600" Height="300" HorizontalAlignment="Left">
  17. <FlipView.ItemTemplate>
  18. <DataTemplate>
  19. <TextBlock Text="{Binding Title}" FontSize="26.667" />
  20. </DataTemplate>
  21. </FlipView.ItemTemplate>
  22. <FlipView.ItemContainerStyle>
  23. <Style TargetType="FlipViewItem">
  24. <Setter Property="Background" Value="Blue" />
  25. </Style>
  26. </FlipView.ItemContainerStyle>
  27. </local:MyFlipView>
  28. </SemanticZoom.ZoomedInView>
  29.  
  30. <!--
  31. 缩小后的视图,概述数据
  32. -->
  33. <SemanticZoom.ZoomedOutView>
  34. <GridView Name="gridView" HorizontalAlignment="Left">
  35. <GridView.ItemTemplate>
  36. <DataTemplate>
  37. <Grid Background="#022a56" Width="100" Height="100">
  38. <TextBlock Text="{Binding Title}" Foreground="#ffffff" Opacity="0.9" FontSize="14.667" Margin="5" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" />
  39. </Grid>
  40. </DataTemplate>
  41. </GridView.ItemTemplate>
  42. <GridView.ItemsPanel>
  43. <ItemsPanelTemplate>
  44. <WrapGrid MaximumRowsOrColumns="8" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal" />
  45. </ItemsPanelTemplate>
  46. </GridView.ItemsPanel>
  47. <GridView.ItemContainerStyle>
  48. <Style TargetType="GridViewItem">
  49. <Setter Property="Margin" Value="5 5 5 30" />
  50. <Setter Property="HorizontalContentAlignment" Value="Center" />
  51. <Setter Property="VerticalContentAlignment" Value="Center" />
  52. </Style>
  53. </GridView.ItemContainerStyle>
  54. </GridView>
  55. </SemanticZoom.ZoomedOutView>
  56. </SemanticZoom>
  57. </Grid>
  58. </Page>

SemanticZoom/CustomView.xaml.cs

  1. /*
  2. * 演示如何自定义 SemanticZoom 视图
  3. * 演示步骤:
  4. * 1、在 ZoomedOutView 视图中的 GridView 中选中某一项
  5. * 2、展开 ZoomedInView 视图后,其内的 FlipView 显示之前被选中项的所有子数据(需要开发一个实现了 ISemanticZoomInformation 接口的自定义 FlipView,参见 MyFlipView.cs)
  6. *
  7. * 注:
  8. * GridView 和 ListView 均实现了 ISemanticZoomInformation 接口,所以可以在 SemanticZoom 的两个视图间有关联地切换
  9. * 要让其它控件也实现类似的功能,就必须使其实现 ISemanticZoomInformation 接口
  10. */
  11.  
  12. using System.Collections.Generic;
  13. using System.Linq;
  14. using System.Xml.Linq;
  15. using Windows.UI.Xaml.Controls;
  16.  
  17. namespace XamlDemo.Controls.SemanticZoom
  18. {
  19. public sealed partial class CustomView : Page
  20. {
  21. public CustomView()
  22. {
  23. this.InitializeComponent();
  24.  
  25. XElement root = XElement.Load("SiteMap.xml");
  26. var items = LoadData(root);
  27.  
  28. // 绑定数据
  29. gridView.ItemsSource = items;
  30. }
  31.  
  32. // 获取数据
  33. private List<NavigationModel> LoadData(XElement root)
  34. {
  35. if (root == null)
  36. return null;
  37.  
  38. var items = from n in root.Elements("node")
  39. select new NavigationModel
  40. {
  41. Title = (string)n.Attribute("title"),
  42. Url = (string)n.Attribute("url"),
  43. Items = LoadData(n)
  44. };
  45.  
  46. return items.ToList();
  47. }
  48. }
  49.  
  50. public class NavigationModel
  51. {
  52. public string Title { get; set; }
  53. public string Url { get; set; }
  54. public List<NavigationModel> Items { get; set; }
  55. }
  56. }

OK
[源码下载]

重新想象 Windows 8 Store Apps (13) - 控件之 SemanticZoom的更多相关文章

  1. 重新想象 Windows 8 Store Apps (17) - 控件基础: Measure, Arrange, GeneralTransform, VisualTree

    原文:重新想象 Windows 8 Store Apps (17) - 控件基础: Measure, Arrange, GeneralTransform, VisualTree [源码下载] 重新想象 ...

  2. 重新想象 Windows 8 Store Apps (15) - 控件 UI: 字体继承, Style, ControlTemplate, SystemResource, VisualState, VisualStateManager

    原文:重新想象 Windows 8 Store Apps (15) - 控件 UI: 字体继承, Style, ControlTemplate, SystemResource, VisualState ...

  3. 重新想象 Windows 8 Store Apps (16) - 控件基础: 依赖属性, 附加属性, 控件的继承关系, 路由事件和命中测试

    原文:重新想象 Windows 8 Store Apps (16) - 控件基础: 依赖属性, 附加属性, 控件的继承关系, 路由事件和命中测试 [源码下载] 重新想象 Windows 8 Store ...

  4. 重新想象 Windows 8 Store Apps (14) - 控件 UI: RenderTransform, Projection, Clip, UseLayoutRounding

    原文:重新想象 Windows 8 Store Apps (14) - 控件 UI: RenderTransform, Projection, Clip, UseLayoutRounding [源码下 ...

  5. 重新想象 Windows 8 Store Apps (12) - 控件之 GridView 特性: 拖动项, 项尺寸可变, 分组显示

    原文:重新想象 Windows 8 Store Apps (12) - 控件之 GridView 特性: 拖动项, 项尺寸可变, 分组显示 [源码下载] 重新想象 Windows 8 Store Ap ...

  6. 重新想象 Windows 8 Store Apps (11) - 控件之 ListView 和 GridView

    原文:重新想象 Windows 8 Store Apps (11) - 控件之 ListView 和 GridView [源码下载] 重新想象 Windows 8 Store Apps (11) - ...

  7. 重新想象 Windows 8 Store Apps (10) - 控件之 ScrollViewer 特性: Chaining, Rail, Inertia, Snap, Zoom

    原文:重新想象 Windows 8 Store Apps (10) - 控件之 ScrollViewer 特性: Chaining, Rail, Inertia, Snap, Zoom [源码下载] ...

  8. 重新想象 Windows 8 Store Apps (9) - 控件之 ScrollViewer 基础

    原文:重新想象 Windows 8 Store Apps (9) - 控件之 ScrollViewer 基础 [源码下载] 重新想象 Windows 8 Store Apps (9) - 控件之 Sc ...

  9. 重新想象 Windows 8 Store Apps (7) - 控件之布局控件: Canvas, Grid, StackPanel, VirtualizingStackPanel, WrapGrid, VariableSizedWrapGrid

    原文:重新想象 Windows 8 Store Apps (7) - 控件之布局控件: Canvas, Grid, StackPanel, VirtualizingStackPanel, WrapGr ...

随机推荐

  1. 如何在Android Studio上使用Github

    首先,登陆到Github上并创建一个新repository.在屏幕右上角,点击“+”标记,并且选择“New repository”. 现在完成这个表格以新建一个叫做testproject的新repos ...

  2. 14.5.4 InnoDB File-Per-Table Tablespaces 每个表一个文件

    14.5.4 InnoDB File-Per-Table Tablespaces 每个表一个文件 从历史上看, 所有的InnoDB 表和索引是存储在system 表空间, 这个整体的方法是针对机器专注 ...

  3. java 显示目录下全部文件

    package gao.org; import java.awt.HeadlessException; import java.io.File; import javax.swing.JFileCho ...

  4. listview改变选中行字体颜色

    [android]listview改变选中行字体颜色 目标:选中item,其字体设置为#3197FF,未选中的,其字体为#FFFFFF 与listvew设置选中行item背景图片一样,使用select ...

  5. ACdream 1135(MST-最小生成树边上2个值,维护第一个最小的前提下让还有一个最小)

    F - MST Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) SubmitStatu ...

  6. 最终结算“Git Windowsclient保存username与password”问题

    Git - How to use netrc file on windows - Stack Overflow 这就是正确答案,我们已经验证过了,以下具体描写叙述一下解决方法: 1. 在Windows ...

  7. zoj3795 Grouping --- 良好的沟通,寻找最长的公路

    给定一个图,为了保持图分裂至少成多个集合的集合内可以使点没有直接或间接的关系. 首先,题意可以得到图中可能含有环.该环的内侧是肯定是要被拆卸. 图点降低建DAG画画,能想象..图从零点渗透深入,在点中 ...

  8. hdu1042(大数模板)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1042 在网上找了个大数模板方便以后用得到. #include<iostream> #inc ...

  9. 3p

    哈,不要自卑.爱情和婚姻可遇不可求,缘到自然成.首要的是人好,容貌別太差,毕竟天天在一起看着要舒心才好,另外应该有上进心,避免势利小人.这些,都要看机缘.所谓right person at right ...

  10. NYOJ 284 坦克大战 【BFS】+【优先队列】

    坦克大战 时间限制:1000 ms  |  内存限制:65535 KB 难度:3 描写叙述 Many of us had played the game "Battle city" ...