Skip to content

Commit

Permalink
代码清理
Browse files Browse the repository at this point in the history
  • Loading branch information
LorisYounger committed Mar 30, 2024
1 parent d0f985c commit a04d590
Show file tree
Hide file tree
Showing 104 changed files with 388 additions and 1,007 deletions.
4 changes: 1 addition & 3 deletions VPet-Simulator.Core/Display/Main.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using LinePutScript;
using LinePutScript.Localization.WPF;
using LinePutScript.Localization.WPF;
using Panuon.WPF.UI;
using System;
using System.Linq;
using System.Media;
using System.Threading;
using System.Threading.Tasks;
Expand Down
12 changes: 4 additions & 8 deletions VPet-Simulator.Core/Display/MainDisplay.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
using System;
using System.Threading.Tasks;
using LinePutScript.Localization.WPF;
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using static VPet_Simulator.Core.GraphCore;
using Panuon.WPF.UI;
using LinePutScript.Localization.WPF;
using static VPet_Simulator.Core.GraphInfo;
using System.Xml.Linq;
using System.Linq;
using System.Windows.Media;

namespace VPet_Simulator.Core
{
Expand Down
1 change: 0 additions & 1 deletion VPet-Simulator.Core/Display/MainLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using static VPet_Simulator.Core.GraphHelper;
using static VPet_Simulator.Core.GraphInfo;

Expand Down
17 changes: 6 additions & 11 deletions VPet-Simulator.Core/Display/ToolBar.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
using System;
using Panuon.WPF.UI;
using System;
using System.Collections.Generic;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Timers;
using Timer = System.Timers.Timer;
using Panuon.WPF.UI;
using System.Windows.Threading;
using LinePutScript;
using LinePutScript.Localization.WPF;
using static VPet_Simulator.Core.GraphInfo;
using System.Collections.Generic;
using static VPet_Simulator.Core.GraphHelper;
using System.ComponentModel;
using System.Reflection;
using static VPet_Simulator.Core.GraphInfo;
using static VPet_Simulator.Core.Main;
using static System.Net.Mime.MediaTypeNames;
using Timer = System.Timers.Timer;

namespace VPet_Simulator.Core
{
Expand Down
6 changes: 1 addition & 5 deletions VPet-Simulator.Core/Display/WorkTimer.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using LinePutScript;
using LinePutScript.Converter;
using LinePutScript.Localization.WPF;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
using LinePutScript.Localization.WPF;
using static VPet_Simulator.Core.GraphHelper;
using static VPet_Simulator.Core.GraphInfo;

Expand Down
9 changes: 3 additions & 6 deletions VPet-Simulator.Core/Graph/FoodAnimation.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
using System;
using LinePutScript;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using static VPet_Simulator.Core.Picture;
using static VPet_Simulator.Core.IGraph;
using LinePutScript;
using System.IO;
using static VPet_Simulator.Core.GraphCore;
using System.Linq;

namespace VPet_Simulator.Core
{
Expand Down
3 changes: 0 additions & 3 deletions VPet-Simulator.Core/Graph/GraphCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
using LinePutScript.Converter;
using LinePutScript.Dictionary;
using LinePutScript.Localization.WPF;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows;
using System.Xml.Linq;
using static VPet_Simulator.Core.GraphHelper;
using static VPet_Simulator.Core.GraphInfo;

Expand Down
15 changes: 5 additions & 10 deletions VPet-Simulator.Core/Graph/GraphHelper.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
using LinePutScript;
using LinePutScript.Converter;
using LinePutScript.Localization.WPF;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using static VPet_Simulator.Core.GraphInfo;
using static VPet_Simulator.Core.IGraph;
using static VPet_Simulator.Core.Picture;
using System.Windows.Controls;
using System.Windows.Media;
using LinePutScript.Converter;
using System.Windows;
using Panuon.WPF.UI;
using LinePutScript.Localization.WPF;

namespace VPet_Simulator.Core
{
Expand Down
3 changes: 0 additions & 3 deletions VPet-Simulator.Core/Graph/GraphInfo.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using LinePutScript;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static VPet_Simulator.Core.GraphHelper;

namespace VPet_Simulator.Core
Expand Down
10 changes: 1 addition & 9 deletions VPet-Simulator.Core/Graph/IGraph.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
using LinePutScript;
using System;
using System.IO;
using System.Linq;
using System.Threading;
using System;
using System.Windows.Controls;
using System.Windows.Media;
using static VPet_Simulator.Core.GraphCore;

using static VPet_Simulator.Core.IGraph;
using static VPet_Simulator.Core.Picture;

namespace VPet_Simulator.Core
{
Expand Down
77 changes: 6 additions & 71 deletions VPet-Simulator.Core/Graph/PNGAnimation.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
using System;
using LinePutScript;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Drawing;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using System.Windows;
using System.Threading;
using System.Drawing;
using LinePutScript;
using static VPet_Simulator.Core.GraphCore;
using static VPet_Simulator.Core.Picture;

namespace VPet_Simulator.Core
Expand Down Expand Up @@ -84,69 +82,6 @@ public PNGAnimation(GraphCore graphCore, string path, FileInfo[] paths, GraphInf
GraphCore.CommUIElements["Image2.PNGAnimation"] = new System.Windows.Controls.Image() { Height = 500 };
}
Task.Run(() => startup(path, paths));
//if (storemem)
//foreach (var file in paths)
//{
// int time = int.Parse(file.Name.Split('.').Reverse().ToArray()[1].Split('_').Last());
// var img = new Image()
// {
// Source = new BitmapImage(new Uri(file.FullName)),
// Visibility = Visibility.Hidden
// };
// MainGrid.Children.Add(img);
// Animations.Add(new Animation(this, time, () => img.Visibility = Visibility.Visible, () => img.Visibility = Visibility.Hidden));
//}
//else
//{
// Image[] imgs = new Image[3];
// imgs[0] = new Image()
// {
// Visibility = Visibility.Hidden
// };
// imgs[1] = new Image()
// {
// Visibility = Visibility.Hidden
// };
// imgs[2] = new Image()
// {
// Visibility = Visibility.Hidden
// };
// int time = int.Parse(paths[0].Name.Split('.').Reverse().ToArray()[1].Split('_').Last());
// //第一张图:有专门自己的图层
// var img = new Image()
// {
// Source = new BitmapImage(new Uri(paths[0].FullName)),
// Visibility = Visibility.Hidden
// };
// MainGrid.Children.Add(img);
// MainGrid.Children.Add(imgs[0]);
// MainGrid.Children.Add(imgs[1]);
// MainGrid.Children.Add(imgs[2]);
// Animations.Add(new Animation(this, time, () =>
// {
// img.Visibility = Visibility.Visible;
// imgs[1].Source = new BitmapImage(new Uri(paths[1].FullName));
// }, () => img.Visibility = Visibility.Hidden));

// int last = paths.Count() - 1;
// for (int i = 1; i < last; i++)
// {
// time = int.Parse(paths[i].Name.Split('.').Reverse().ToArray()[1].Split('_').Last());
// var im1 = imgs[i % 3];
// var im2 = imgs[(i + 1) % 3];
// var st3 = paths[i + 1].FullName;
// Animations.Add(new Animation(this, time, () =>
// {
// im1.Visibility = Visibility.Visible;
// im2.Source = new BitmapImage(new Uri(st3));
// }, () => im1.Visibility = Visibility.Hidden));
// }
// //最后一张图: 不处理下一张图的imgsSources

// time = int.Parse(paths[last].Name.Split('.').Reverse().ToArray()[1].Split('_').Last());
// Animations.Add(new Animation(this, time, () => imgs[last % 3].Visibility = Visibility.Visible
// , () => imgs[last % 3].Visibility = Visibility.Hidden));
//}
}

public static void LoadGraph(GraphCore graph, FileSystemInfo path, ILine info)
Expand Down
11 changes: 5 additions & 6 deletions VPet-Simulator.Core/Graph/Picture.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using LinePutScript;
using System;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
using System.IO;
using System.Windows.Controls;
using LinePutScript;
using static VPet_Simulator.Core.GraphCore;
using System.Windows.Media.Imaging;
using static VPet_Simulator.Core.Picture;


Expand Down Expand Up @@ -193,5 +192,5 @@ public interface IImageRun : IGraph
}
}


}
3 changes: 1 addition & 2 deletions VPet-Simulator.Core/Handle/Function.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using LinePutScript.Dictionary;
using System;
using System;
using System.Windows;
using System.Windows.Media;

Expand Down
2 changes: 1 addition & 1 deletion VPet-Simulator.Core/Handle/GameCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class GameCore
/// <summary>
/// 触摸范围和事件列表
/// </summary>
public List<TouchArea> TouchEvent = new List<TouchArea>();
public List<TouchArea> TouchEvent = new List<TouchArea>();
/// <summary>
/// 图形核心
/// </summary>
Expand Down
8 changes: 1 addition & 7 deletions VPet-Simulator.Core/Handle/IFood.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VPet_Simulator.Core
namespace VPet_Simulator.Core
{
/// <summary>
/// 食物接口
Expand Down
2 changes: 0 additions & 2 deletions VPet-Simulator.Core/Handle/IGameSave.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using LinePutScript;
using LinePutScript.Converter;
using System;

namespace VPet_Simulator.Core
{
Expand Down
1 change: 0 additions & 1 deletion VPet-Simulator.Core/Handle/PetLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.IO;
using System.Linq;
using System.Windows.Forms;
using static VPet_Simulator.Core.IGameSave;
using static VPet_Simulator.Core.GraphCore;


Expand Down
6 changes: 1 addition & 5 deletions VPet-Simulator.Tool/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Xml.Linq;

namespace VPet_Simulator.Tool
{
Expand Down Expand Up @@ -90,7 +86,7 @@ static void AnimationReName(int time, DirectoryInfo directoryInfo)
lastf.MoveTo(Path.Combine(directoryInfo.FullName, $"{GetFileName(lastf)}_{id++:D3}_{rpt * time}.png"));
Console.WriteLine("图片处理已完成");
}


public static string GetFileHash(FileInfo fileInfo)
{
Expand Down
5 changes: 0 additions & 5 deletions VPet-Simulator.Windows.Interface/ExtensionFunction.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
using LinePutScript.Localization.WPF;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using VPet_Simulator.Core;
using static VPet_Simulator.Core.GraphHelper;

Expand Down
8 changes: 2 additions & 6 deletions VPet-Simulator.Windows.Interface/GameSave_VPet.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using LinePutScript.Converter;
using LinePutScript;
using LinePutScript;
using LinePutScript.Converter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VPet_Simulator.Core;
using static VPet_Simulator.Core.IGameSave;

Expand Down
8 changes: 0 additions & 8 deletions VPet-Simulator.Windows.Interface/GameSave_v2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@
using LinePutScript.Localization.WPF;
using Panuon.WPF.UI;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using VPet_Simulator.Core;
using static System.Net.Mime.MediaTypeNames;

namespace VPet_Simulator.Windows.Interface
{
Expand Down
3 changes: 1 addition & 2 deletions VPet-Simulator.Windows.Interface/IMainWindow.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using LinePutScript;
using LinePutScript.Dictionary;
using LinePutScript.Dictionary;
using System;
using System.Collections.Generic;
using System.Windows;
Expand Down
Loading

0 comments on commit a04d590

Please sign in to comment.