Initializing Strategy Parts

This commit is contained in:
Luis Fernando Molina committed 2019-05-03 13:00:45 +02:00
1 parent 1e315841b8
commit 48734a1ef0
6 files changed
+33 -58

No files matched your search

+2 -10
View File
@@ -78,17 +78,9 @@ function newFloatingLayer () {
}
}
function initialize (callBackFunction) {
try {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> Entering function.') }
function initialize () {
/* We dont need to initialize anything right now. */
if (callBackFunction !== undefined) { callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE) }
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err.message = ' + err.message) }
if (callBackFunction !== undefined) { callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE) }
}
/* We dont need to initialize anything right now. */
}
function addFloatingObject (pFloatingObject, callBackFunction) {
+2 -15
View File
@@ -31,21 +31,8 @@ function newNoteSets () {
return thisObject
function initialize (pFloatingLayer, callBackFunction) {
/*
During the initialization process, we receive the floatingLayer where all the floatingObjects we will be creating here will live at.
*/
try {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> Entering function.') }
floatingLayer = pFloatingLayer
callBackFunction(GLOBAL.CUSTOM_OK_RESPONSE)
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
}
function initialize (pFloatingLayer) {
floatingLayer = pFloatingLayer
}
function createNoteSet (pPayload, pEventHandler, callBackFunction) {
+2 -11
View File
@@ -35,17 +35,8 @@ function newProfileBalls () {
}
}
function initialize (pFloatingLayer, callBackFunction) {
try {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> Entering function.') }
floatingLayer = pFloatingLayer
callBackFunction(GLOBAL.CUSTOM_OK_RESPONSE)
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
}
function initialize (pFloatingLayer) {
floatingLayer = pFloatingLayer
}
function createNewProfileBall (pPayload, callBackFunction) {
+2 -9
View File
@@ -28,15 +28,8 @@ function newStrategyParts () {
floatingLayer.finalize()
}
function initialize (pFloatingLayer, callBackFunction) {
try {
floatingLayer = pFloatingLayer
callBackFunction(GLOBAL.CUSTOM_OK_RESPONSE)
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
}
function initialize (pFloatingLayer) {
floatingLayer = pFloatingLayer
}
function createNewStrategyPart (pPayload, callBackFunction) {
+9 -12
View File
@@ -11,6 +11,7 @@ function newFloatingSpace () {
let thisObject = {
floatingLayer: undefined, // This is the array of floatingObjects being displayed
profileBalls: undefined,
strategyParts: undefined,
noteSets: undefined,
initialize: initialize,
finalize: finalize
@@ -24,6 +25,7 @@ function newFloatingSpace () {
thisObject.floatingLayer.finalize()
thisObject.profileBalls.finalize()
thisObject.strategyParts.finalize()
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] finalize -> err = ' + err.stack) }
}
@@ -31,21 +33,16 @@ function newFloatingSpace () {
function initialize (callBackFunction) {
thisObject.floatingLayer = newFloatingLayer()
thisObject.floatingLayer.initialize(onFloatingLayerInitialized)
thisObject.floatingLayer.initialize()
function onFloatingLayerInitialized (err) {
thisObject.profileBalls = newProfileBalls()
thisObject.profileBalls.initialize(thisObject.floatingLayer, onProfileBallsInitialized)
thisObject.profileBalls = newProfileBalls()
thisObject.profileBalls.initialize(thisObject.floatingLayer)
function onProfileBallsInitialized (err) {
thisObject.noteSets = newNoteSets()
thisObject.noteSets.initialize(thisObject.floatingLayer, onNoteSetsInitialized)
thisObject.noteSets = newNoteSets()
thisObject.noteSets.initialize(thisObject.floatingLayer)
function onNoteSetsInitialized (err) {
}
}
}
thisObject.strategyParts = newStrategyParts()
thisObject.strategyParts.initialize(thisObject.floatingLayer)
}
}
+16 -1
View File
@@ -37,7 +37,22 @@ function newStrategyCollectionItem () {
}
function onMouseClick (event) {
console.log('ITEM CLICKED')
if (productPlotter.plotter.payload !== undefined) {
let imageId = pProductCard.bot.devTeam + '.' + pProductCard.bot.profilePicture
productPlotter.plotter.payload.profile.upLabel = pProductCard.product.shortDisplayName
productPlotter.plotter.payload.profile.downLabel = pProductCard.bot.displayName
productPlotter.plotter.payload.profile.imageId = imageId
productPlotter.plotter.payload.profile.botAvatar = pProductCard.bot.avatar
canvas.floatingSpace.profileBalls.createNewProfileBall(productPlotter.plotter.payload, onProfileBallCreated)
function onProfileBallCreated (err, pProfileHandle) {
productPlotter.profile = pProfileHandle
/* There is no policy yet of what to do if this fails. */
}
}
}
function getContainer (point) {