Moved MapEntity saving methods to the shared project (the server needs to be able to save subs in the campaign mode)

This commit is contained in:
Joonas Rikkonen
2017-08-30 18:09:48 +03:00
parent dc3b9baa0d
commit 96a64d45dc
26 changed files with 386 additions and 434 deletions
@@ -3,10 +3,10 @@ using FarseerPhysics;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
//using Microsoft.Xna.Framework.Graphics;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Xml.Linq;
namespace Barotrauma
{
@@ -89,6 +89,15 @@ namespace Barotrauma
get { return false; }
}
protected bool ResizeHorizontal
{
get { return prefab != null && prefab.ResizeHorizontal; }
}
protected bool ResizeVertical
{
get { return prefab != null && prefab.ResizeVertical; }
}
public virtual bool SelectableInEditor
{
get { return true; }
@@ -374,10 +383,14 @@ namespace Barotrauma
linkedSub.OnMapLoaded();
}
}
public virtual void OnMapLoaded() { }
public virtual void OnMapLoaded() { }
public virtual XElement Save(XElement parentElement)
{
DebugConsole.ThrowError("Saving entity " + GetType() + " failed.");
return null;
}
public void RemoveLinked(MapEntity e)
{