Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
weeeBox committed Dec 20, 2016
1 parent 9c1864e commit 200be4b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@

namespace LunarEditor
{
class ConsoleFilteredDelegate : ConsoleViewCompositeFilter, ITableViewDataSource, ITableViewDelegate, ICConsoleDelegate
class CConsoleFilteredDelegate : ConsoleViewCompositeFilter, ITableViewDataSource, ITableViewDelegate, ICConsoleDelegate
{
private ConsoleView m_consoleView;

private CCycleArray<int> m_filteredIndices;

private ConsoleViewLogLevelFilter m_levelFilter;
private ConsoleViewTagFilter m_tagFilter;
private ConsoleViewTextFilter m_textFilter;
private CConsoleViewLogLevelFilter m_levelFilter;
private CConsoleViewTagFilter m_tagFilter;
private CConsoleViewTextFilter m_textFilter;

private int m_oldConsoleEntriesHeadIndex;

public ConsoleFilteredDelegate(ConsoleView consoleView)
public CConsoleFilteredDelegate(ConsoleView consoleView)
{
m_consoleView = consoleView;
m_oldConsoleEntriesHeadIndex = Entries.HeadIndex;
Expand All @@ -54,7 +54,7 @@ public bool SetFilterLogLevel(CLogLevel level)
{
if (m_levelFilter == null)
{
m_levelFilter = new ConsoleViewLogLevelFilter(level);
m_levelFilter = new CConsoleViewLogLevelFilter(level);
bool shouldAppend = this.HasFilters; // not the first filter

AddFilter(m_levelFilter);
Expand Down Expand Up @@ -95,7 +95,7 @@ public bool AddFilterTags(params CTag[] tags)

if (m_tagFilter == null)
{
m_tagFilter = new ConsoleViewTagFilter();
m_tagFilter = new CConsoleViewTagFilter();
AddFilter(m_tagFilter);
}

Expand Down Expand Up @@ -125,7 +125,7 @@ public bool SetFilterTags(params CTag[] tags)

if (m_tagFilter == null)
{
m_tagFilter = new ConsoleViewTagFilter();
m_tagFilter = new CConsoleViewTagFilter();
AddFilter(m_tagFilter);
}

Expand Down Expand Up @@ -190,7 +190,7 @@ public bool SetFilterText(string filterText)
return ApplyFilter(this);
}

m_textFilter = new ConsoleViewTextFilter(filterText);
m_textFilter = new CConsoleViewTextFilter(filterText);
bool shouldAppend = this.HasFilters; // not the first filter

AddFilter(m_textFilter);
Expand Down Expand Up @@ -349,11 +349,11 @@ private CCycleArray<ConsoleViewCellEntry> Entries
#endregion
}

class ConsoleViewTextFilter : ConsoleViewFilterBase
class CConsoleViewTextFilter : ConsoleViewFilterBase
{
private string m_text;

public ConsoleViewTextFilter(string text)
public CConsoleViewTextFilter(string text)
: base(0)
{
this.Text = text;
Expand All @@ -378,11 +378,11 @@ public string Text
}
}

class ConsoleViewTagFilter : ConsoleViewFilterBase
class CConsoleViewTagFilter : ConsoleViewFilterBase
{
private HashSet<CTag> m_tags;

public ConsoleViewTagFilter()
public CConsoleViewTagFilter()
: base(1)
{
m_tags = new HashSet<CTag>();
Expand Down Expand Up @@ -431,11 +431,11 @@ public bool HasTags
}
}

class ConsoleViewLogLevelFilter : ConsoleViewFilterBase
class CConsoleViewLogLevelFilter : ConsoleViewFilterBase
{
private CLogLevel m_level;

public ConsoleViewLogLevelFilter(CLogLevel level)
public CConsoleViewLogLevelFilter(CLogLevel level)
: base(2)
{
this.Level = level;
Expand Down
6 changes: 3 additions & 3 deletions Project/Assets/LunarPlugin/Editor/Console/CConsoleView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ConsoleView : TableView, ITableViewDataSource, ITableViewDelegate, ICConso
{
private readonly CAbstractConsole m_console;

private ConsoleFilteredDelegate m_filteredDelegate;
private CConsoleFilteredDelegate m_filteredDelegate;

private ICTextMeasure m_textMeasure;
private float m_overridenContentWidth;
Expand All @@ -53,7 +53,7 @@ public ConsoleView(CAbstractConsole console, float width, float height)

m_textMeasure = CreateTextMeasure();

m_filteredDelegate = new ConsoleFilteredDelegate(this);
m_filteredDelegate = new CConsoleFilteredDelegate(this);

ReloadData();
}
Expand Down Expand Up @@ -331,7 +331,7 @@ public void RemoveFilterTags(params CTag[] tags)
SetFilteredDelegate(m_filteredDelegate, needReload);
}

private void SetFilteredDelegate(ConsoleFilteredDelegate del, bool needReload = true)
private void SetFilteredDelegate(CConsoleFilteredDelegate del, bool needReload = true)
{
if (del == null || !del.HasFilters)
{
Expand Down

0 comments on commit 200be4b

Please sign in to comment.