adjust namespaces in entire solution

This commit is contained in:
jvyden 2021-10-06 02:29:18 -04:00
commit 4b2862135d
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
9 changed files with 43 additions and 42 deletions

View file

@ -1,5 +1,6 @@
using System; using System;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using ProjectLighthouse.Types;
namespace ProjectLighthouse.Controllers { namespace ProjectLighthouse.Controllers {
[ApiController] [ApiController]

View file

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
using ProjectLighthouse.Types;
namespace ProjectLighthouse.Controllers { namespace ProjectLighthouse.Controllers {
[ApiController] [ApiController]

View file

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using ProjectLighthouse.Serialization; using ProjectLighthouse.Serialization;
using ProjectLighthouse.Types;
namespace ProjectLighthouse.Controllers { namespace ProjectLighthouse.Controllers {
[ApiController] [ApiController]

View file

@ -1,4 +1,4 @@
namespace ProjectLighthouse { namespace ProjectLighthouse.Types {
public enum LevelTags { public enum LevelTags {
Brilliant, Brilliant,
Beautiful, Beautiful,

View file

@ -1,6 +1,6 @@
using ProjectLighthouse.Serialization; using ProjectLighthouse.Serialization;
namespace ProjectLighthouse { namespace ProjectLighthouse.Types {
public class Location { public class Location {
public int X; public int X;
public int Y; public int Y;

View file

@ -1,16 +1,15 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Xml.Serialization;
using ProjectLighthouse.Serialization; using ProjectLighthouse.Serialization;
namespace ProjectLighthouse { namespace ProjectLighthouse.Types {
public class LoginResult { public class LoginResult {
public string AuthTicket { get; set; } public string AuthTicket { get; set; }
public string LbpEnvVer { get; set; } public string LbpEnvVer { get; set; }
public string Serialize() { public string Serialize() {
return LbpSerializer.GetElements( return LbpSerializer.GetElements(
new KeyValuePair<string, object>("authTicket", AuthTicket), new KeyValuePair<string, object>("authTicket", this.AuthTicket),
new KeyValuePair<string, object>("lbpEnvVer", LbpEnvVer) new KeyValuePair<string, object>("lbpEnvVer", this.LbpEnvVer)
); );
} }
} }

View file

@ -1,6 +1,6 @@
using ProjectLighthouse.Serialization; using ProjectLighthouse.Serialization;
namespace ProjectLighthouse { namespace ProjectLighthouse.Types {
public class NewsEntry { public class NewsEntry {
public int Id { get; set; } public int Id { get; set; }
public string Title { get; set; } public string Title { get; set; }
@ -11,13 +11,13 @@ namespace ProjectLighthouse {
public long Date { get; set; } public long Date { get; set; }
public string Serialize() { public string Serialize() {
return LbpSerializer.GetStringElement("id", Id) + return LbpSerializer.GetStringElement("id", this.Id) +
LbpSerializer.GetStringElement("title", Title) + LbpSerializer.GetStringElement("title", this.Title) +
LbpSerializer.GetStringElement("summary", Summary) + LbpSerializer.GetStringElement("summary", this.Summary) +
LbpSerializer.GetStringElement("text", Text) + LbpSerializer.GetStringElement("text", this.Text) +
LbpSerializer.GetStringElement("date", Date) + LbpSerializer.GetStringElement("date", this.Date) +
Image.Serialize() + this.Image.Serialize() +
LbpSerializer.GetStringElement("category", Category); LbpSerializer.GetStringElement("category", this.Category);
} }
} }
} }

View file

@ -1,14 +1,14 @@
using ProjectLighthouse.Serialization; using ProjectLighthouse.Serialization;
namespace ProjectLighthouse { namespace ProjectLighthouse.Types {
public class NewsImage { public class NewsImage {
public string Hash { get; set; } public string Hash { get; set; }
public string Alignment { get; set; } public string Alignment { get; set; }
public string Serialize() { public string Serialize() {
return LbpSerializer.GetStringElement("image", return LbpSerializer.GetStringElement("image",
LbpSerializer.GetStringElement("hash", Hash) + LbpSerializer.GetStringElement("hash", this.Hash) +
LbpSerializer.GetStringElement("alignment", Alignment)); LbpSerializer.GetStringElement("alignment", this.Alignment));
} }
} }
} }

View file

@ -1,7 +1,6 @@
using ProjectLighthouse.Serialization; using ProjectLighthouse.Serialization;
using ProjectLighthouse.Types;
namespace ProjectLighthouse { namespace ProjectLighthouse.Types {
public class User { public class User {
public string Username { get; set; } public string Username { get; set; }
public string IconHash { get; set; } public string IconHash { get; set; }
@ -31,7 +30,7 @@ namespace ProjectLighthouse {
public static int EntitledSlots = 20; public static int EntitledSlots = 20;
public int UsedSlots { get; set; } public int UsedSlots { get; set; }
public int FreeSlots => EntitledSlots - UsedSlots; public int FreeSlots => EntitledSlots - this.UsedSlots;
private static string[] slotTypes = { private static string[] slotTypes = {
"lbp1", "lbp1",
@ -46,12 +45,12 @@ namespace ProjectLighthouse {
foreach(string s in slotTypes) { foreach(string s in slotTypes) {
string slotType = s; // vars in foreach are immutable, define helper var string slotType = s; // vars in foreach are immutable, define helper var
slots += LbpSerializer.GetStringElement(slotType + "UsedSlots", UsedSlots); slots += LbpSerializer.GetStringElement(slotType + "UsedSlots", this.UsedSlots);
if(slotType == "lbp1") slotType = ""; if(slotType == "lbp1") slotType = "";
slots += LbpSerializer.GetStringElement(slotType + "EntitledSlots", EntitledSlots); slots += LbpSerializer.GetStringElement(slotType + "EntitledSlots", EntitledSlots);
// ReSharper disable once StringLiteralTypo // ReSharper disable once StringLiteralTypo
slots += LbpSerializer.GetStringElement(slotType + slotType == "crossControl" ? "PurchsedSlots" : "PurchasedSlots", 0); slots += LbpSerializer.GetStringElement(slotType + slotType == "crossControl" ? "PurchsedSlots" : "PurchasedSlots", 0);
slots += LbpSerializer.GetStringElement(slotType + "FreeSlots", FreeSlots); slots += LbpSerializer.GetStringElement(slotType + "FreeSlots", this.FreeSlots);
} }
return slots; return slots;
@ -60,28 +59,28 @@ namespace ProjectLighthouse {
#endregion Slots #endregion Slots
public string Serialize() { public string Serialize() {
string user = LbpSerializer.GetTaggedStringElement("npHandle", Username, "icon", IconHash) + string user = LbpSerializer.GetTaggedStringElement("npHandle", this.Username, "icon", this.IconHash) +
LbpSerializer.GetStringElement("game", Game) + LbpSerializer.GetStringElement("game", this.Game) +
this.SerializeSlots() + this.SerializeSlots() +
LbpSerializer.GetStringElement("lists", Lists) + LbpSerializer.GetStringElement("lists", this.Lists) +
LbpSerializer.GetStringElement("lists_quota", ListsQuota) + LbpSerializer.GetStringElement("lists_quota", ListsQuota) +
LbpSerializer.GetStringElement("heartCount", HeartCount) + LbpSerializer.GetStringElement("heartCount", this.HeartCount) +
LbpSerializer.GetStringElement("yay2", YayHash) + LbpSerializer.GetStringElement("yay2", this.YayHash) +
LbpSerializer.GetStringElement("boo2", BooHash) + LbpSerializer.GetStringElement("boo2", this.BooHash) +
LbpSerializer.GetStringElement("biography", Biography) + LbpSerializer.GetStringElement("biography", this.Biography) +
LbpSerializer.GetStringElement("reviewCount", ReviewCount) + LbpSerializer.GetStringElement("reviewCount", this.ReviewCount) +
LbpSerializer.GetStringElement("commentCount", CommentCount) + LbpSerializer.GetStringElement("commentCount", this.CommentCount) +
LbpSerializer.GetStringElement("photosByMeCount", PhotosByMeCount) + LbpSerializer.GetStringElement("photosByMeCount", this.PhotosByMeCount) +
LbpSerializer.GetStringElement("photosWithMeCount", PhotosWithMeCount) + LbpSerializer.GetStringElement("photosWithMeCount", this.PhotosWithMeCount) +
LbpSerializer.GetStringElement("commentsEnabled", CommentsEnabled) + LbpSerializer.GetStringElement("commentsEnabled", this.CommentsEnabled) +
Location.Serialize() + this.Location.Serialize() +
LbpSerializer.GetStringElement("favouriteSlotCount", FavouriteSlotCount) + LbpSerializer.GetStringElement("favouriteSlotCount", this.FavouriteSlotCount) +
LbpSerializer.GetStringElement("favouriteUserCount", FavouriteUserCount) + LbpSerializer.GetStringElement("favouriteUserCount", this.FavouriteUserCount) +
LbpSerializer.GetStringElement("lolcatftwCount", lolcatftwCount) + LbpSerializer.GetStringElement("lolcatftwCount", this.lolcatftwCount) +
LbpSerializer.GetStringElement("pins", Pins) + LbpSerializer.GetStringElement("pins", this.Pins) +
LbpSerializer.GetStringElement("staffChallengeGoldCount", StaffChallengeGoldCount) + LbpSerializer.GetStringElement("staffChallengeGoldCount", this.StaffChallengeGoldCount) +
LbpSerializer.GetStringElement("staffChallengeSilverCount", StaffChallengeSilverCount) + LbpSerializer.GetStringElement("staffChallengeSilverCount", this.StaffChallengeSilverCount) +
LbpSerializer.GetStringElement("staffChallengeBronzeCount", StaffChallengeBronzeCount) + LbpSerializer.GetStringElement("staffChallengeBronzeCount", this.StaffChallengeBronzeCount) +
LbpSerializer.GetStringElement("photos", "") + LbpSerializer.GetStringElement("photos", "") +
this.ClientsConnected.Serialize(); this.ClientsConnected.Serialize();